Don't store invites in sync API that aren't relevant to local users

This commit is contained in:
Neil Alexander 2022-05-09 14:30:13 +01:00
parent 09d754cfbf
commit f5f7d6da42
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -327,9 +327,11 @@ func (s *OutputRoomEventConsumer) onNewInviteEvent(
ctx context.Context, msg api.OutputNewInviteEvent, ctx context.Context, msg api.OutputNewInviteEvent,
) { ) {
if msg.Event.StateKey() == nil { if msg.Event.StateKey() == nil {
log.WithFields(log.Fields{ return
"event": string(msg.Event.JSON()), }
}).Panicf("roomserver output log: invite has no state key") if _, serverName, err := gomatrixserverlib.SplitID('@', *msg.Event.StateKey()); err != nil {
return
} else if serverName != s.cfg.Matrix.ServerName {
return return
} }
pduPos, err := s.db.AddInviteEvent(ctx, msg.Event) pduPos, err := s.db.AddInviteEvent(ctx, msg.Event)