mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Add is_host_joined to slave storage
This commit is contained in:
parent
c7cd35d682
commit
4daa397a00
@ -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)
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user