Add is_host_joined to slave storage

This commit is contained in:
Erik Johnston 2016-08-26 13:02:08 +01:00
parent c7cd35d682
commit 4daa397a00
2 changed files with 6 additions and 3 deletions

View file

@ -127,6 +127,8 @@ class SlavedEventStore(BaseSlavedStore):
get_room_events_stream_for_rooms = (
DataStore.get_room_events_stream_for_rooms.__func__
)
is_host_joined = DataStore.is_host_joined.__func__
_is_host_joined = RoomMemberStore.__dict__["_is_host_joined"]
get_stream_token_for_event = DataStore.get_stream_token_for_event.__func__
_set_before_and_after = staticmethod(DataStore._set_before_and_after)

View file

@ -396,6 +396,7 @@ class RoomMemberStore(SQLBaseStore):
keyvalues={
"membership": Membership.JOIN,
},
batch_size=1000,
desc="_get_joined_users_from_context",
)
@ -409,8 +410,8 @@ class RoomMemberStore(SQLBaseStore):
# To do this we set the state_group to a new object as object() != object()
state_group = object()
return self._get_joined_users_from_context(
room_id, state_group, state_ids
return self._is_host_joined(
room_id, host, state_group, state_ids
)
@cachedInlineCallbacks(num_args=3)
@ -430,7 +431,7 @@ class RoomMemberStore(SQLBaseStore):
logger.warn("state_key not user_id: %s", state_key)
continue
event = yield self.store.get_event(event_id, allow_none=True)
event = yield self.get_event(event_id, allow_none=True)
if event and event.content["membership"] == Membership.JOIN:
defer.returnValue(True)