summary refs log tree commit diff
path: root/synapse/handlers/profile.py
diff options
context:
space:
mode:
authorDaniel Wagner-Hall <dawagner@gmail.com>2016-02-12 15:11:59 +0000
committerDaniel Wagner-Hall <dawagner@gmail.com>2016-02-12 15:11:59 +0000
commitd7aa103f00be191c107a9ee148727c5e52fb8005 (patch)
tree00826864651550411f164dcb510cd1f7d6e5b6de /synapse/handlers/profile.py
parentMerge pull request #574 from matrix-org/markjh/connection_closed (diff)
parentMerge two of the room join codepaths (diff)
downloadsynapse-d7aa103f00be191c107a9ee148727c5e52fb8005.tar.xz
Merge pull request #575 from matrix-org/daniel/roomcleanup
Merge two of the room join codepaths

There's at least one more to merge in.

Side-effects:
 * Stop reporting None as displayname and avatar_url in some cases
 * Joining a room by alias populates guest-ness in join event
 * Remove unspec'd PUT version of /join/<room_id_or_alias> which has not
   been called on matrix.org according to logs
 * Stop recording access_token_id on /join/room_id - currently we don't
   record it on /join/room_alias; I can try to thread it through at some
   point.
Diffstat (limited to 'synapse/handlers/profile.py')
-rw-r--r--synapse/handlers/profile.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py
index 629e6e3594..32af622733 100644
--- a/synapse/handlers/profile.py
+++ b/synapse/handlers/profile.py
@@ -169,8 +169,15 @@ class ProfileHandler(BaseHandler):
             consumeErrors=True
         ).addErrback(unwrapFirstError)
 
-        state["displayname"] = displayname
-        state["avatar_url"] = avatar_url
+        if displayname is None:
+            del state["displayname"]
+        else:
+            state["displayname"] = displayname
+
+        if avatar_url is None:
+            del state["avatar_url"]
+        else:
+            state["avatar_url"] = avatar_url
 
         defer.returnValue(None)