From 860b1b4841618ec401c3652dcf19ac8b5d167f50 Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Thu, 12 Feb 2015 19:11:52 +0000 Subject: Only attempt to fetch presence state of JOINed members in room initialSync (SYN-202) --- synapse/handlers/message.py | 1 + 1 file changed, 1 insertion(+) (limited to 'synapse/handlers/message.py') diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index 3355adefcf..c6d6188d9d 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -372,6 +372,7 @@ class MessageHandler(BaseHandler): room_members = [ m for m in current_state.values() if m.type == EventTypes.Member + and m.content["membership"] == Membership.JOIN ] presence_handler = self.hs.get_handlers().presence_handler -- cgit 1.4.1 From 29805213d1c20c89c20a4b3075c30597b4402338 Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Thu, 12 Feb 2015 19:12:57 +0000 Subject: Can now remove the FIXME too --- synapse/handlers/message.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'synapse/handlers/message.py') diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index c6d6188d9d..5f4cc1a84b 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -386,16 +386,9 @@ class MessageHandler(BaseHandler): ) presence.append(member_presence) except SynapseError as e: - if e.code == 404: - # FIXME: We are doing this as a warn since this gets hit a - # lot and spams the logs. Why is this happening? - logger.warn( - "Failed to get member presence of %r", m.user_id - ) - else: - logger.exception( - "Failed to get member presence of %r", m.user_id - ) + logger.exception( + "Failed to get member presence of %r", m.user_id + ) time_now = self.clock.time_msec() -- cgit 1.4.1 From 5f6e6530d0f43c637e527cfe1797801879dbc389 Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Thu, 12 Feb 2015 19:15:23 +0000 Subject: Appease pyflakes --- synapse/handlers/message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'synapse/handlers/message.py') diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index 5f4cc1a84b..e028cfc2e9 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -385,7 +385,7 @@ class MessageHandler(BaseHandler): as_event=True, ) presence.append(member_presence) - except SynapseError as e: + except SynapseError: logger.exception( "Failed to get member presence of %r", m.user_id ) -- cgit 1.4.1 From 93d07c87dc9b837492fa0f691a77e716a2fe512b Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Thu, 12 Feb 2015 19:19:37 +0000 Subject: Reindent code to be less human-readable to keep pep8 from complaining --- synapse/handlers/message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'synapse/handlers/message.py') diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index e028cfc2e9..7b9685be7f 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -372,7 +372,7 @@ class MessageHandler(BaseHandler): room_members = [ m for m in current_state.values() if m.type == EventTypes.Member - and m.content["membership"] == Membership.JOIN + and m.content["membership"] == Membership.JOIN ] presence_handler = self.hs.get_handlers().presence_handler -- cgit 1.4.1