Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #6493 from matrix-org/erikj/invite_state_config
Browse files Browse the repository at this point in the history
* commit 'e1544b0af':
  Newsfile
  Pull out room_invite_state_types config option once.
  • Loading branch information
anoadragon453 committed Mar 19, 2020
2 parents a1a8fe3 + e1544b0 commit 7fe3852
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/6493.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix small performance regression for sending invites.
4 changes: 3 additions & 1 deletion synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ def __init__(self, hs):
self.config = hs.config
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)

# This is only used to get at ratelimit function, and maybe_kick_guest_users
Expand Down Expand Up @@ -916,7 +918,7 @@ def is_inviter_member_event(e):
state_to_include_ids = [
e_id
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)
]

Expand Down

0 comments on commit 7fe3852

Please sign in to comment.