mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-15 05:32:25 +03:00
Handle event_format federation in /sync responses (#3192)
This commit is contained in:
parent
11fd2f019b
commit
bb2ab62cbf
16 changed files with 739 additions and 84 deletions
|
@ -63,6 +63,11 @@ func (p *InviteStreamProvider) IncrementalSync(
|
|||
return from
|
||||
}
|
||||
|
||||
eventFormat := synctypes.FormatSync
|
||||
if req.Filter.EventFormat == synctypes.EventFormatFederation {
|
||||
eventFormat = synctypes.FormatSyncFederation
|
||||
}
|
||||
|
||||
for roomID, inviteEvent := range invites {
|
||||
user := spec.UserID{}
|
||||
validRoomID, err := spec.NewRoomID(inviteEvent.RoomID())
|
||||
|
@ -87,7 +92,7 @@ func (p *InviteStreamProvider) IncrementalSync(
|
|||
if _, ok := req.IgnoredUsers.List[user.String()]; ok {
|
||||
continue
|
||||
}
|
||||
ir := types.NewInviteResponse(inviteEvent, user, sk)
|
||||
ir := types.NewInviteResponse(inviteEvent, user, sk, eventFormat)
|
||||
req.Response.Rooms.Invite[roomID] = ir
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue