summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Baker <dbkr@matrix.org>2015-01-30 23:05:49 +0000
committerDavid Baker <dbkr@matrix.org>2015-01-30 23:06:39 +0000
commitfe10b882b74479b6d139039956932b98629c8165 (patch)
tree92cde5c7e59119d8d77b09ec752d92266eacdb63
parentResign events when we return them via /query_auth/ (diff)
downloadsynapse-fe10b882b74479b6d139039956932b98629c8165.tar.xz
Don't assume all member events have a display nme.
Diffstat (limited to '')
-rw-r--r--synapse/push/__init__.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/synapse/push/__init__.py b/synapse/push/__init__.py
index 6a302305fb..75867b3c3c 100644
--- a/synapse/push/__init__.py
+++ b/synapse/push/__init__.py
@@ -204,10 +204,11 @@ class Pusher(object):
             event_type='m.room.member',
             state_key=ev['user_id']
         )
-        if len(their_member_events_for_room) > 0:
-            dn = their_member_events_for_room[0].content['displayname']
-            if dn is not None:
-                ctx['sender_display_name'] = dn
+        for mev in their_member_events_for_room:
+            if mev.content['membership'] == 'join' and 'displayname' in mev.content:
+                dn = mev.content['displayname']
+                if dn is not None:
+                    ctx['sender_display_name'] = dn
 
         defer.returnValue(ctx)