diff options
author | Erik Johnston <erik@matrix.org> | 2017-05-05 11:02:34 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-02-15 09:51:09 +0000 |
commit | 08a6b88e3d895494fa4fba6e719e70395d5948fe (patch) | |
tree | decaca743c9028440f1c08d5cb92c03285b1525c | |
parent | Make push actions rotation configurable (diff) | |
download | synapse-08a6b88e3d895494fa4fba6e719e70395d5948fe.tar.xz |
Disable presence
This reverts commit 0ebd376a53bb75ade6d65db2d716478758c2c9f0 and disables presence a bit more
-rw-r--r-- | synapse/app/synchrotron.py | 1 | ||||
-rw-r--r-- | synapse/handlers/initial_sync.py | 1 | ||||
-rw-r--r-- | synapse/handlers/presence.py | 4 | ||||
-rw-r--r-- | synapse/handlers/sync.py | 2 | ||||
-rw-r--r-- | synapse/rest/client/v1/presence.py | 2 | ||||
-rw-r--r-- | tests/rest/client/v1/test_rooms.py | 12 |
6 files changed, 15 insertions, 7 deletions
diff --git a/synapse/app/synchrotron.py b/synapse/app/synchrotron.py index f87531f1b6..0ba3151991 100644 --- a/synapse/app/synchrotron.py +++ b/synapse/app/synchrotron.py @@ -117,6 +117,7 @@ class SynchrotronPresence(object): logger.info("Presence process_id is %r", self.process_id) def send_user_sync(self, user_id, is_syncing, last_sync_ms): + return self.hs.get_tcp_replication().send_user_sync(user_id, is_syncing, last_sync_ms) def mark_as_coming_online(self, user_id): diff --git a/synapse/handlers/initial_sync.py b/synapse/handlers/initial_sync.py index c5267b4b84..df56252185 100644 --- a/synapse/handlers/initial_sync.py +++ b/synapse/handlers/initial_sync.py @@ -372,6 +372,7 @@ class InitialSyncHandler(BaseHandler): @defer.inlineCallbacks def get_presence(): + defer.returnValue([]) states = yield presence_handler.get_states( [m.user_id for m in room_members], as_event=True, diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py index cb158ba962..2a2cfd9339 100644 --- a/synapse/handlers/presence.py +++ b/synapse/handlers/presence.py @@ -372,6 +372,7 @@ class PresenceHandler(object): """We've seen the user do something that indicates they're interacting with the app. """ + return user_id = user.to_string() bump_active_time_counter.inc() @@ -401,6 +402,7 @@ class PresenceHandler(object): Useful for streams that are not associated with an actual client that is being used by a user. """ + affect_presence = False if affect_presence: curr_sync = self.user_to_num_current_syncs.get(user_id, 0) self.user_to_num_current_syncs[user_id] = curr_sync + 1 @@ -443,6 +445,7 @@ class PresenceHandler(object): Returns: set(str): A set of user_id strings. """ + return set() syncing_user_ids = { user_id for user_id, count in self.user_to_num_current_syncs.items() if count @@ -462,6 +465,7 @@ class PresenceHandler(object): syncing_user_ids(set(str)): The set of user_ids that are currently syncing on that server. """ + return # Grab the previous list of user_ids that were syncing on that process prev_syncing_user_ids = ( diff --git a/synapse/handlers/sync.py b/synapse/handlers/sync.py index b12988f3c9..c95ca2ade8 100644 --- a/synapse/handlers/sync.py +++ b/synapse/handlers/sync.py @@ -585,7 +585,7 @@ class SyncHandler(object): since_token is None and sync_config.filter_collection.blocks_all_presence() ) - if not block_all_presence_data: + if False and not block_all_presence_data: yield self._generate_sync_entry_for_presence( sync_result_builder, newly_joined_rooms, newly_joined_users ) diff --git a/synapse/rest/client/v1/presence.py b/synapse/rest/client/v1/presence.py index 4a73813c58..b7e765fa0e 100644 --- a/synapse/rest/client/v1/presence.py +++ b/synapse/rest/client/v1/presence.py @@ -81,7 +81,7 @@ class PresenceStatusRestServlet(ClientV1RestServlet): except Exception: raise SynapseError(400, "Unable to parse state") - yield self.presence_handler.set_state(user, state) + # yield self.presence_handler.set_state(user, state) defer.returnValue((200, {})) diff --git a/tests/rest/client/v1/test_rooms.py b/tests/rest/client/v1/test_rooms.py index 9f37255381..2e9fc84c13 100644 --- a/tests/rest/client/v1/test_rooms.py +++ b/tests/rest/client/v1/test_rooms.py @@ -984,11 +984,13 @@ class RoomInitialSyncTestCase(RestTestCase): self.assertTrue("presence" in response) - presence_by_user = { - e["content"]["user_id"]: e for e in response["presence"] - } - self.assertTrue(self.user_id in presence_by_user) - self.assertEquals("m.presence", presence_by_user[self.user_id]["type"]) + # presence is turned off on hotfixes + + # presence_by_user = { + # e["content"]["user_id"]: e for e in response["presence"] + # } + # self.assertTrue(self.user_id in presence_by_user) + # self.assertEquals("m.presence", presence_by_user[self.user_id]["type"]) class RoomMessageListTestCase(RestTestCase): |