mirror of
https://github.com/matrix-org/sliding-sync.git
synced 2025-03-10 13:37:11 +00:00
Comment on escaped dots
This commit is contained in:
parent
0af85096aa
commit
9620a624d7
@ -274,6 +274,7 @@ func (h *Handler) Accumulate(ctx context.Context, userID, deviceID, roomID strin
|
|||||||
for i := range timeline.Events {
|
for i := range timeline.Events {
|
||||||
// Delete MSC4115 field as it isn't accurate when we reuse the same event for >1 user
|
// Delete MSC4115 field as it isn't accurate when we reuse the same event for >1 user
|
||||||
timeline.Events[i], _ = sjson.DeleteBytes(timeline.Events[i], "unsigned.membership")
|
timeline.Events[i], _ = sjson.DeleteBytes(timeline.Events[i], "unsigned.membership")
|
||||||
|
// escape .'s in the key name
|
||||||
timeline.Events[i], _ = sjson.DeleteBytes(timeline.Events[i], `unsigned.io\.element\.msc4115\.membership`)
|
timeline.Events[i], _ = sjson.DeleteBytes(timeline.Events[i], `unsigned.io\.element\.msc4115\.membership`)
|
||||||
parsed := gjson.ParseBytes(timeline.Events[i])
|
parsed := gjson.ParseBytes(timeline.Events[i])
|
||||||
eventID := parsed.Get("event_id").Str
|
eventID := parsed.Get("event_id").Str
|
||||||
@ -377,6 +378,7 @@ func (h *Handler) Accumulate(ctx context.Context, userID, deviceID, roomID strin
|
|||||||
func (h *Handler) Initialise(ctx context.Context, roomID string, state []json.RawMessage) error {
|
func (h *Handler) Initialise(ctx context.Context, roomID string, state []json.RawMessage) error {
|
||||||
for i := range state { // Delete MSC4115 field as it isn't accurate when we reuse the same event for >1 user
|
for i := range state { // Delete MSC4115 field as it isn't accurate when we reuse the same event for >1 user
|
||||||
state[i], _ = sjson.DeleteBytes(state[i], "unsigned.membership")
|
state[i], _ = sjson.DeleteBytes(state[i], "unsigned.membership")
|
||||||
|
// escape .'s in the key name
|
||||||
state[i], _ = sjson.DeleteBytes(state[i], `unsigned.io\.element\.msc4115\.membership`)
|
state[i], _ = sjson.DeleteBytes(state[i], `unsigned.io\.element\.msc4115\.membership`)
|
||||||
}
|
}
|
||||||
res, err := h.Store.Initialise(roomID, state)
|
res, err := h.Store.Initialise(roomID, state)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user