summary refs log tree commit diff
path: root/synapse/handlers/presence.py
diff options
context:
space:
mode:
authorWill Hunt <half-shot@molrams.com>2016-08-10 12:57:30 +0100
committerWill Hunt <half-shot@molrams.com>2016-08-10 12:59:59 +0100
commit2510db3e760320b8eeffd9b9a0a0a193ce49f5ba (patch)
tree5a9d55c280363329cc1cbc9eb0b38f6426e53c16 /synapse/handlers/presence.py
parentMerge pull request #996 from matrix-org/erikj/tls_error (diff)
downloadsynapse-2510db3e760320b8eeffd9b9a0a0a193ce49f5ba.tar.xz
Don't change status_msg on /sync
Diffstat (limited to 'synapse/handlers/presence.py')
-rw-r--r--synapse/handlers/presence.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py
index 6b70fa3817..2293b5fdf7 100644
--- a/synapse/handlers/presence.py
+++ b/synapse/handlers/presence.py
@@ -672,7 +672,7 @@ class PresenceHandler(object):
             ])
 
     @defer.inlineCallbacks
-    def set_state(self, target_user, state):
+    def set_state(self, target_user, state, ignore_status_msg=False):
         """Set the presence state of the user.
         """
         status_msg = state.get("status_msg", None)
@@ -689,10 +689,13 @@ class PresenceHandler(object):
         prev_state = yield self.current_state_for_user(user_id)
 
         new_fields = {
-            "state": presence,
-            "status_msg": status_msg if presence != PresenceState.OFFLINE else None
+            "state": presence
         }
 
+        if not ignore_status_msg:
+            msg = status_msg if presence != PresenceState.OFFLINE else None
+            new_fields["status_msg"] = msg
+
         if presence == PresenceState.ONLINE:
             new_fields["last_active_ts"] = self.clock.time_msec()