diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2022-11-15 17:21:16 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-15 17:21:16 +0000 |
commit | 9b8bb55430e658c8752c0b093416eed6d977cb0d (patch) | |
tree | c35f315f504549431c3a90ca014a15131d516059 /federationapi/consumers | |
parent | 5c9aed6af90dc77a7d82a4d16a165715cdd560ca (diff) |
Don't get blacklisted hosts when querying joined servers (#2880)
Otherwise we just waste time/CPU.
Diffstat (limited to 'federationapi/consumers')
-rw-r--r-- | federationapi/consumers/keychange.go | 4 | ||||
-rw-r--r-- | federationapi/consumers/presence.go | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/federationapi/consumers/keychange.go b/federationapi/consumers/keychange.go index 7d1ae0f8..601257d4 100644 --- a/federationapi/consumers/keychange.go +++ b/federationapi/consumers/keychange.go @@ -128,7 +128,7 @@ func (t *KeyChangeConsumer) onDeviceKeyMessage(m api.DeviceMessage) bool { } // send this key change to all servers who share rooms with this user. - destinations, err := t.db.GetJoinedHostsForRooms(t.ctx, queryRes.RoomIDs, true) + destinations, err := t.db.GetJoinedHostsForRooms(t.ctx, queryRes.RoomIDs, true, true) if err != nil { sentry.CaptureException(err) logger.WithError(err).Error("failed to calculate joined hosts for rooms user is in") @@ -189,7 +189,7 @@ func (t *KeyChangeConsumer) onCrossSigningMessage(m api.DeviceMessage) bool { return true } // send this key change to all servers who share rooms with this user. - destinations, err := t.db.GetJoinedHostsForRooms(t.ctx, queryRes.RoomIDs, true) + destinations, err := t.db.GetJoinedHostsForRooms(t.ctx, queryRes.RoomIDs, true, true) if err != nil { sentry.CaptureException(err) logger.WithError(err).Error("fedsender key change consumer: failed to calculate joined hosts for rooms user is in") diff --git a/federationapi/consumers/presence.go b/federationapi/consumers/presence.go index 153fc40b..29b16f37 100644 --- a/federationapi/consumers/presence.go +++ b/federationapi/consumers/presence.go @@ -111,7 +111,7 @@ func (t *OutputPresenceConsumer) onMessage(ctx context.Context, msgs []*nats.Msg } // send this presence to all servers who share rooms with this user. - joined, err := t.db.GetJoinedHostsForRooms(t.ctx, queryRes.RoomIDs, true) + joined, err := t.db.GetJoinedHostsForRooms(t.ctx, queryRes.RoomIDs, true, true) if err != nil { log.WithError(err).Error("failed to get joined hosts") return true |