Rename 'events_key' to 'room_key' so it matches the name of the event source

This commit is contained in:
Paul "LeoNerd" Evans 2014-08-29 18:39:09 +01:00
parent 490f142d73
commit 4bfdec1eb2
4 changed files with 10 additions and 10 deletions

View file

@ -274,11 +274,11 @@ class MessageHandler(BaseRoomHandler):
messages, token = yield self.store.get_recent_events_for_room( messages, token = yield self.store.get_recent_events_for_room(
event.room_id, event.room_id,
limit=limit, limit=limit,
end_token=now_token.events_key, end_token=now_token.room_key,
) )
start_token = now_token.copy_and_replace("events_key", token[0]) start_token = now_token.copy_and_replace("room_key", token[0])
end_token = now_token.copy_and_replace("events_key", token[1]) end_token = now_token.copy_and_replace("room_key", token[1])
d["messages"] = { d["messages"] = {
"chunk": [m.get_dict() for m in messages], "chunk": [m.get_dict() for m in messages],

View file

@ -476,13 +476,13 @@ class RoomEventSource(object):
events, end_key = yield self.store.get_room_events_stream( events, end_key = yield self.store.get_room_events_stream(
user_id=user.to_string(), user_id=user.to_string(),
from_key=from_token.events_key, from_key=from_token.room_key,
to_key=to_key, to_key=to_key,
room_id=None, room_id=None,
limit=limit, limit=limit,
) )
end_token = from_token.copy_and_replace("events_key", end_key) end_token = from_token.copy_and_replace("room_key", end_key)
defer.returnValue((events, end_token)) defer.returnValue((events, end_token))
@ -496,17 +496,17 @@ class RoomEventSource(object):
limit = pagination_config.limit limit = pagination_config.limit
direction = pagination_config.direction direction = pagination_config.direction
to_key = to_token.events_key if to_token else None to_key = to_token.room_key if to_token else None
events, next_key = yield self.store.paginate_room_events( events, next_key = yield self.store.paginate_room_events(
room_id=key, room_id=key,
from_key=from_token.events_key, from_key=from_token.room_key,
to_key=to_key, to_key=to_key,
direction=direction, direction=direction,
limit=limit, limit=limit,
with_feedback=True with_feedback=True
) )
next_token = from_token.copy_and_replace("events_key", next_key) next_token = from_token.copy_and_replace("room_key", next_key)
defer.returnValue((events, next_token)) defer.returnValue((events, next_token))

View file

@ -54,7 +54,7 @@ class EventSources(object):
@defer.inlineCallbacks @defer.inlineCallbacks
def get_current_token(self): def get_current_token(self):
token = StreamToken( token = StreamToken(
events_key=( room_key=(
yield self.sources["room"].get_current_token_part() yield self.sources["room"].get_current_token_part()
), ),
presence_key=( presence_key=(

View file

@ -97,7 +97,7 @@ class RoomID(DomainSpecificString):
class StreamToken( class StreamToken(
namedtuple( namedtuple(
"Token", "Token",
("events_key", "presence_key", "typing_key") ("room_key", "presence_key", "typing_key")
) )
): ):
_SEPARATOR = "_" _SEPARATOR = "_"