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

Pull out room_invite_state_types config option once. #6493

Merged
merged 2 commits into from
Dec 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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