From 0c1deca5745d40859b368a9d6978845eb9811fcc Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Mon, 15 Dec 2014 16:14:53 +0000 Subject: [PATCH 1/2] Remember to hook up the typing event stream to the notifier as well --- synapse/notifier.py | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/synapse/notifier.py b/synapse/notifier.py index 5e1495044..383230caf 100644 --- a/synapse/notifier.py +++ b/synapse/notifier.py @@ -146,7 +146,11 @@ class Notifier(object): Will wake up all listeners for the given users and rooms. """ yield run_on_reactor() + + # TODO(paul): This is horrible, having to manually list every event + # source here individually presence_source = self.event_sources.sources["presence"] + typing_source = self.event_sources.sources["typing"] listeners = set() @@ -158,19 +162,33 @@ class Notifier(object): @defer.inlineCallbacks def notify(listener): - events, end_key = yield presence_source.get_new_events_for_user( - listener.user, - listener.from_token.presence_key, - listener.limit, + presence_events, presence_end_key = ( + yield presence_source.get_new_events_for_user( + listener.user, + listener.from_token.presence_key, + listener.limit, + ) + ) + typing_events, typing_end_key = ( + yield typing_source.get_new_events_for_user( + listener.user, + listener.from_token.typing_key, + listener.limit, + ) ) - if events: + if presence_events or typing_events: end_token = listener.from_token.copy_and_replace( - "presence_key", end_key + "presence_key", presence_end_key + ).copy_and_replace( + "typing_key", typing_end_key ) listener.notify( - self, events, listener.from_token, end_token + self, + presence_events + typing_events, + listener.from_token, + end_token ) def eb(failure): From 67c9585656d2c241abefbdea79f0edbb543d9eb5 Mon Sep 17 00:00:00 2001 From: Kegsay Date: Mon, 15 Dec 2014 16:57:53 +0000 Subject: [PATCH 2/2] Update media_repository.py _ not - --- synapse/media/v1/media_repository.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/media/v1/media_repository.py b/synapse/media/v1/media_repository.py index cbc49aa32..2070ec3c7 100644 --- a/synapse/media/v1/media_repository.py +++ b/synapse/media/v1/media_repository.py @@ -39,7 +39,7 @@ class MediaRepositoryResource(Resource): <= HTTP/1.1 200 OK Content-Type: application/json - { "content-uri": "mxc:///" } + { "content_uri": "mxc:///" } => GET /_matrix/media/v1/download// HTTP/1.1