Merge pull request #6493 from matrix-org/erikj/invite_state_config

Pull out room_invite_state_types config option once.
pull/6506/head
Erik Johnston 2019-12-09 12:23:21 +00:00 committed by GitHub
commit e1544b0af8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

1
changelog.d/6493.bugfix Normal file
View File

@ -0,0 +1 @@
Fix small performance regression for sending invites.

View File

@ -363,6 +363,8 @@ class EventCreationHandler(object):
self.config = hs.config self.config = hs.config
self.require_membership_for_aliases = hs.config.require_membership_for_aliases self.require_membership_for_aliases = hs.config.require_membership_for_aliases
self.room_invite_state_types = self.hs.config.room_invite_state_types
self.send_event_to_master = ReplicationSendEventRestServlet.make_client(hs) self.send_event_to_master = ReplicationSendEventRestServlet.make_client(hs)
# This is only used to get at ratelimit function, and maybe_kick_guest_users # This is only used to get at ratelimit function, and maybe_kick_guest_users
@ -916,7 +918,7 @@ class EventCreationHandler(object):
state_to_include_ids = [ state_to_include_ids = [
e_id e_id
for k, e_id in iteritems(current_state_ids) for k, e_id in iteritems(current_state_ids)
if k[0] in self.hs.config.room_invite_state_types if k[0] in self.room_invite_state_types
or k == (EventTypes.Member, event.sender) or k == (EventTypes.Member, event.sender)
] ]