diff options
author | devonh <devon.dmytro@gmail.com> | 2023-08-31 15:33:38 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-31 15:33:38 +0000 |
commit | bb2ab62cbf02abb6f600e6eb39fde67aa2ff3215 (patch) | |
tree | 0c2f7caa34a589cdd8338bee92fd7376f7c71313 /userapi | |
parent | 11fd2f019bb6325155c2fa825b82c1fbef07b300 (diff) |
Handle event_format federation in /sync responses (#3192)
Diffstat (limited to 'userapi')
-rw-r--r-- | userapi/consumers/roomserver.go | 4 | ||||
-rw-r--r-- | userapi/util/notify_test.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/userapi/consumers/roomserver.go b/userapi/consumers/roomserver.go index a88b2129..8863d258 100644 --- a/userapi/consumers/roomserver.go +++ b/userapi/consumers/roomserver.go @@ -321,7 +321,7 @@ func (s *OutputRoomEventConsumer) processMessage(ctx context.Context, event *rst return fmt.Errorf("queryUserIDForSender: userID unknown for %s", *sk) } } - cevent := synctypes.ToClientEvent(event, synctypes.FormatAll, sender, sk) + cevent := synctypes.ToClientEvent(event, synctypes.FormatAll, sender.String(), sk, event.Unsigned()) var member *localMembership member, err = newLocalMembership(&cevent) if err != nil { @@ -566,7 +566,7 @@ func (s *OutputRoomEventConsumer) notifyLocal(ctx context.Context, event *rstype // UNSPEC: the spec doesn't say this is a ClientEvent, but the // fields seem to match. room_id should be missing, which // matches the behaviour of FormatSync. - Event: synctypes.ToClientEvent(event, synctypes.FormatSync, sender, sk), + Event: synctypes.ToClientEvent(event, synctypes.FormatSync, sender.String(), sk, event.Unsigned()), // TODO: this is per-device, but it's not part of the primary // key. So inserting one notification per profile tag doesn't // make sense. What is this supposed to be? Sytests require it diff --git a/userapi/util/notify_test.go b/userapi/util/notify_test.go index 3017069b..27e77cf7 100644 --- a/userapi/util/notify_test.go +++ b/userapi/util/notify_test.go @@ -106,7 +106,7 @@ func TestNotifyUserCountsAsync(t *testing.T) { } sk := "" if err := db.InsertNotification(ctx, aliceLocalpart, serverName, dummyEvent.EventID(), 0, nil, &api.Notification{ - Event: synctypes.ToClientEvent(dummyEvent, synctypes.FormatAll, *sender, &sk), + Event: synctypes.ToClientEvent(dummyEvent, synctypes.FormatAll, sender.String(), &sk, dummyEvent.Unsigned()), }); err != nil { t.Error(err) } |