summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Telatynski <7t3chguy@gmail.com>2018-06-13 10:31:01 +0100
committerMichael Telatynski <7t3chguy@gmail.com>2018-06-13 10:31:01 +0100
commit94700e55fa93653d678fb5e27322fde4c0a15f3d (patch)
treed61b6b96c5d213efad87a8dc364baf8d4a85e1f3
parentMerge pull request #2334 from matrix-org/erikj/refactor_transport_server (diff)
downloadsynapse-94700e55fa93653d678fb5e27322fde4c0a15f3d.tar.xz
if inviter_display_name == ""||None then default to inviter MXID
to prevent email invite from "None"
-rw-r--r--synapse/handlers/room_member.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py
index b3f979b246..1b8dfa8254 100644
--- a/synapse/handlers/room_member.py
+++ b/synapse/handlers/room_member.py
@@ -565,6 +565,10 @@ class RoomMemberHandler(BaseHandler):
             inviter_display_name = member_event.content.get("displayname", "")
             inviter_avatar_url = member_event.content.get("avatar_url", "")
 
+        # if user has no display name, default to their MXID
+        if not inviter_display_name:
+            inviter_display_name = user.to_string()
+
         canonical_room_alias = ""
         canonical_alias_event = room_state.get((EventTypes.CanonicalAlias, ""))
         if canonical_alias_event: