Only send (invite) events to the AS if it's interested in it
This should hopefully fix (and maybe also
@@ -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,9 +281,11 @@ func (s *OutputRoomEventConsumer) appserviceJoinedAtEvent(ctx context.Context, e
case err != nil:
continue
case membership.Membership == gomatrixserverlib.Join:
+ if appservice.IsInterestedInUserID(*ev.StateKey) {
return true
}
}
+ }
} else {
log.WithFields(log.Fields{
"appservice": appservice.ID,
