summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorDaniel Wagner-Hall <daniel@matrix.org>2016-02-15 16:02:22 +0000
committerDaniel Wagner-Hall <daniel@matrix.org>2016-02-15 16:02:22 +0000
commit73e616df2a4e0fb7bc83340f558dede32cc2efc3 (patch)
tree8632c5afb3108f4b6278880bfbc4e3cfef398af5 /synapse
parentInline _do_join as it now only has one caller (diff)
downloadsynapse-73e616df2a4e0fb7bc83340f558dede32cc2efc3.tar.xz
Inline _do_local_membership_update
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/room.py25
1 files changed, 7 insertions, 18 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index 44bab19c51..d17e5c1b7b 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -24,7 +24,6 @@ from synapse.api.constants import (
 )
 from synapse.api.errors import AuthError, StoreError, SynapseError, Codes
 from synapse.util import stringutils, unwrapFirstError
-from synapse.util.async import run_on_reactor
 from synapse.util.logcontext import preserve_context_over_fn
 
 from signedjson.sign import verify_signed_json
@@ -466,6 +465,7 @@ class RoomMemberHandler(BaseHandler):
             SynapseError if there was a problem changing the membership.
         """
         target_user_id = event.state_key
+        target_user = UserID.from_string(event.state_key)
 
         prev_state = context.current_state.get(
             (EventTypes.Member, target_user_id),
@@ -523,9 +523,10 @@ class RoomMemberHandler(BaseHandler):
             else:
                 logger.debug("Doing normal join")
 
-                yield self._do_local_membership_update(
+                yield self.handle_new_client_event(
                     event,
-                    context=context,
+                    context,
+                    extra_users=[target_user],
                     ratelimit=ratelimit,
                 )
 
@@ -560,9 +561,10 @@ class RoomMemberHandler(BaseHandler):
                 defer.returnValue({})
                 return
 
-            yield self._do_local_membership_update(
+            yield self.handle_new_client_event(
                 event,
-                context=context,
+                context,
+                extra_users=[target_user],
                 ratelimit=ratelimit,
             )
 
@@ -651,19 +653,6 @@ class RoomMemberHandler(BaseHandler):
         defer.returnValue(room_ids)
 
     @defer.inlineCallbacks
-    def _do_local_membership_update(self, event, context, ratelimit=True):
-        yield run_on_reactor()
-
-        target_user = UserID.from_string(event.state_key)
-
-        yield self.handle_new_client_event(
-            event,
-            context,
-            extra_users=[target_user],
-            ratelimit=ratelimit,
-        )
-
-    @defer.inlineCallbacks
     def do_3pid_invite(
             self,
             room_id,