mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 07:28:27 +00:00
Only send (invite) events to the AS if it's interested in it (#2692)
This should hopefully fix #2691 (and maybe also #2690)
This commit is contained in:
parent
fea869b41f
commit
350a5e5393
1 changed files with 4 additions and 2 deletions
|
@ -134,7 +134,7 @@ func (s *OutputRoomEventConsumer) onMessage(
|
||||||
}
|
}
|
||||||
|
|
||||||
case api.OutputTypeNewInviteEvent:
|
case api.OutputTypeNewInviteEvent:
|
||||||
if output.NewInviteEvent == nil {
|
if output.NewInviteEvent == nil || !s.appserviceIsInterestedInEvent(ctx, output.NewInviteEvent.Event, state.ApplicationService) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
events = append(events, output.NewInviteEvent.Event)
|
events = append(events, output.NewInviteEvent.Event)
|
||||||
|
@ -281,9 +281,11 @@ func (s *OutputRoomEventConsumer) appserviceJoinedAtEvent(ctx context.Context, e
|
||||||
case err != nil:
|
case err != nil:
|
||||||
continue
|
continue
|
||||||
case membership.Membership == gomatrixserverlib.Join:
|
case membership.Membership == gomatrixserverlib.Join:
|
||||||
|
if appservice.IsInterestedInUserID(*ev.StateKey) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
"appservice": appservice.ID,
|
"appservice": appservice.ID,
|
||||||
|
|
Loading…
Reference in a new issue