summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-07-27 10:08:39 +0100
committerGitHub <noreply@github.com>2018-07-27 10:08:39 +0100
commitb0b5566f36d126a892425ac4939b2028a3980efe (patch)
tree9750477cdc9998b3aa460bc63a81d2ee917df8f9
parentMerge pull request #3469 from DJViking/master (diff)
parentadd changelog entry for PR#3391 (diff)
downloadsynapse-b0b5566f36d126a892425ac4939b2028a3980efe.tar.xz
Merge pull request #3391 from t3chguy/t3chguy/default_inviter_display_name_3pid
if inviter_display_name == ""||None then default to inviter MXID
-rw-r--r--changelog.d/3391.bugfix1
-rw-r--r--synapse/handlers/room_member.py4
2 files changed, 5 insertions, 0 deletions
diff --git a/changelog.d/3391.bugfix b/changelog.d/3391.bugfix
new file mode 100644
index 0000000000..88eeb50df2
--- /dev/null
+++ b/changelog.d/3391.bugfix
@@ -0,0 +1 @@
+Default inviter_display_name to mxid for email invites
\ No newline at end of file
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py
index a832d91809..0d4a3f4677 100644
--- a/synapse/handlers/room_member.py
+++ b/synapse/handlers/room_member.py
@@ -708,6 +708,10 @@ class RoomMemberHandler(object):
             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: