summary refs log tree commit diff
path: root/synapse/handlers/message.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-12-09 11:50:34 +0000
committerErik Johnston <erik@matrix.org>2019-12-09 11:52:19 +0000
commit8ad8bcbed0bbd8a00ddfbe693b99785b72bb8ee2 (patch)
tree5009830e9b5255aaf313f50842c3307acbea3baa /synapse/handlers/message.py
parentMerge pull request #6469 from matrix-org/erikj/make_database_class (diff)
downloadsynapse-8ad8bcbed0bbd8a00ddfbe693b99785b72bb8ee2.tar.xz
Pull out room_invite_state_types config option once.
Pulling things out of config is currently surprisingly expensive.
Diffstat (limited to 'synapse/handlers/message.py')
-rw-r--r--synapse/handlers/message.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 4f53a5f5dc..54fa216d83 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -363,6 +363,8 @@ class EventCreationHandler(object):
         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
@@ -916,7 +918,7 @@ class EventCreationHandler(object):
                 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)
                 ]