summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/_base.py4
-rw-r--r--synapse/handlers/message.py12
-rw-r--r--synapse/handlers/room.py7
3 files changed, 13 insertions, 10 deletions
diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py
index 871564a3a2..4cbc0c027c 100644
--- a/synapse/handlers/_base.py
+++ b/synapse/handlers/_base.py
@@ -88,10 +88,6 @@ class BaseHandler(object):
         prev_state = ret
 
         if builder.is_state():
-            prev_state = yield self.store.add_event_hashes(
-                prev_state
-            )
-
             builder.prev_state = prev_state
 
         yield self.auth.add_auth_events(builder, context)
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 485d8e8179..8ee560d79a 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -137,6 +137,18 @@ class MessageHandler(BaseHandler):
     def handle_event(self, event_dict):
         builder = self.event_builder_factory.new(event_dict)
 
+
+        if builder.type == EventTypes.Member:
+            membership = builder.content.get("membership", None)
+            if membership == Membership.JOIN:
+                joinee = self.hs.parse_userid(builder.state_key)
+                # If event doesn't include a display name, add one.
+                yield self.distributor.fire(
+                    "collect_presencelike_data",
+                    joinee,
+                    builder.content
+                )
+
         event, context = yield self._create_new_client_event(
             builder=builder,
         )
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index ffcdbcfdf7..4f4b275290 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -187,6 +187,7 @@ class RoomCreationHandler(BaseHandler):
         creation_event = create(
             etype=RoomCreateEvent.TYPE,
             content={"creator": creator.to_string()},
+            state_key="",
         )
 
         join_event = create(
@@ -406,11 +407,6 @@ class RoomMemberHandler(BaseHandler):
         # room_id = RoomID.from_string(event.room_id, self.hs)
         room_id = event.room_id
 
-        # If event doesn't include a display name, add one.
-        yield self.distributor.fire(
-            "collect_presencelike_data", joinee, event.content
-        )
-
         # XXX: We don't do an auth check if we are doing an invite
         # join dance for now, since we're kinda implicitly checking
         # that we are allowed to join when we decide whether or not we
@@ -524,7 +520,6 @@ class RoomMemberHandler(BaseHandler):
             context,
             extra_users=[target_user],
             suppress_auth=(not do_auth),
-            do_invite_host=do_invite_host,
         )