Only send (invite) events to the AS if it's interested in it

This commit is contained in:
Till Faelligen 2022-09-02 15:09:01 +02:00
parent fea869b41f
commit 02ff7a203f
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E

View file

@ -134,7 +134,7 @@ func (s *OutputRoomEventConsumer) onMessage(
}
case api.OutputTypeNewInviteEvent:
if output.NewInviteEvent == nil {
if output.NewInviteEvent == nil || !s.appserviceIsInterestedInEvent(ctx, output.NewInviteEvent.Event, state.ApplicationService) {
continue
}
events = append(events, output.NewInviteEvent.Event)
@ -281,7 +281,9 @@ func (s *OutputRoomEventConsumer) appserviceJoinedAtEvent(ctx context.Context, e
case err != nil:
continue
case membership.Membership == gomatrixserverlib.Join:
return true
if appservice.IsInterestedInUserID(*ev.StateKey) {
return true
}
}
}
} else {