diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-08-29 19:15:23 +0100 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-08-29 19:15:23 +0100 |
commit | a8e8d1d06c078de49711768357267cf4168999ea (patch) | |
tree | fa449b133e1780611f5de9c258c95a6cdf771492 | |
parent | Have EventSource's get_new_events_for_user() API work only on keys within tha... (diff) | |
download | synapse-a8e8d1d06c078de49711768357267cf4168999ea.tar.xz |
Renamed get_current_token_part to get_current_key
Diffstat (limited to '')
-rw-r--r-- | synapse/handlers/presence.py | 2 | ||||
-rw-r--r-- | synapse/handlers/room.py | 4 | ||||
-rw-r--r-- | synapse/handlers/typing.py | 2 | ||||
-rw-r--r-- | synapse/streams/events.py | 12 |
4 files changed, 10 insertions, 10 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py index 05bf145240..cc28151e35 100644 --- a/synapse/handlers/presence.py +++ b/synapse/handlers/presence.py @@ -747,7 +747,7 @@ class PresenceEventSource(object): else: return (([], presence._user_cachemap_latest_serial)) - def get_current_token_part(self): + def get_current_key(self): presence = self.hs.get_handlers().presence_handler return presence._user_cachemap_latest_serial diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index ce15420bf4..c54e0f963b 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -472,7 +472,7 @@ class RoomEventSource(object): def get_new_events_for_user(self, user, from_key, limit): # We just ignore the key for now. - to_key = yield self.get_current_token_part() + to_key = yield self.get_current_key() events, end_key = yield self.store.get_room_events_stream( user_id=user.to_string(), @@ -484,7 +484,7 @@ class RoomEventSource(object): defer.returnValue((events, end_key)) - def get_current_token_part(self): + def get_current_key(self): return self.store.get_room_events_max_id() @defer.inlineCallbacks diff --git a/synapse/handlers/typing.py b/synapse/handlers/typing.py index 238b063483..3268427ecd 100644 --- a/synapse/handlers/typing.py +++ b/synapse/handlers/typing.py @@ -154,7 +154,7 @@ class TypingNotificationEventSource(object): def get_new_events_for_user(self, user, from_key, limit): return ([], from_key) - def get_current_token_part(self): + def get_current_key(self): return 0 def get_pagination_rows(self, user, pagination_config, key): diff --git a/synapse/streams/events.py b/synapse/streams/events.py index 43b6b1eba3..08d6e6f733 100644 --- a/synapse/streams/events.py +++ b/synapse/streams/events.py @@ -31,7 +31,7 @@ class NullSource(object): def get_new_events_for_user(self, user, from_key, limit): return defer.succeed(([], from_key)) - def get_current_token_part(self): + def get_current_key(self): return defer.succeed(0) def get_pagination_rows(self, user, pagination_config, key): @@ -55,13 +55,13 @@ class EventSources(object): def get_current_token(self): token = StreamToken( room_key=( - yield self.sources["room"].get_current_token_part() + yield self.sources["room"].get_current_key() ), presence_key=( - yield self.sources["presence"].get_current_token_part() + yield self.sources["presence"].get_current_key() ), typing_key=( - yield self.sources["typing"].get_current_token_part() + yield self.sources["typing"].get_current_key() ) ) defer.returnValue(token) @@ -72,8 +72,8 @@ class StreamSource(object): """from_key is the key within this event source.""" raise NotImplementedError("get_new_events_for_user") - def get_current_token_part(self): - raise NotImplementedError("get_current_token_part") + def get_current_key(self): + raise NotImplementedError("get_current_key") def get_pagination_rows(self, user, pagination_config, key): raise NotImplementedError("get_rows") |