forked from MirrorHub/synapse
Rename the 'do_users_share_a_room' to something slightly less verb-sounding
This commit is contained in:
parent
967b45bc1a
commit
da3e04df8b
4 changed files with 6 additions and 6 deletions
|
@ -155,7 +155,7 @@ class PresenceHandler(BaseHandler):
|
|||
if observer_user == observed_user:
|
||||
defer.returnValue(True)
|
||||
|
||||
if (yield self.store.do_users_share_a_room(
|
||||
if (yield self.store.user_rooms_intersect(
|
||||
[observer_user, observed_user]
|
||||
)):
|
||||
defer.returnValue(True)
|
||||
|
|
|
@ -165,7 +165,7 @@ class RoomMemberStore(SQLBaseStore):
|
|||
defer.returnValue(results)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def do_users_share_a_room(self, user_list):
|
||||
def user_rooms_intersect(self, user_list):
|
||||
""" Checks whether a list of users share a room.
|
||||
"""
|
||||
user_list_clause = " OR ".join(["m.user_id = ?"] * len(user_list))
|
||||
|
|
|
@ -117,10 +117,10 @@ class PresenceStateTestCase(unittest.TestCase):
|
|||
return defer.succeed([])
|
||||
room_member_handler.get_room_members = get_room_members
|
||||
|
||||
def do_users_share_a_room(userlist):
|
||||
def user_rooms_intersect(userlist):
|
||||
shared = all(map(lambda u: u in self.room_members, userlist))
|
||||
return defer.succeed(shared)
|
||||
self.datastore.do_users_share_a_room = do_users_share_a_room
|
||||
self.datastore.user_rooms_intersect = user_rooms_intersect
|
||||
|
||||
self.mock_start = Mock()
|
||||
self.mock_stop = Mock()
|
||||
|
|
|
@ -107,9 +107,9 @@ class PresenceProfilelikeDataTestCase(unittest.TestCase):
|
|||
return defer.succeed(self.presence_list)
|
||||
self.datastore.get_presence_list = get_presence_list
|
||||
|
||||
def do_users_share_a_room(userlist):
|
||||
def user_rooms_intersect(userlist):
|
||||
return defer.succeed(False)
|
||||
self.datastore.do_users_share_a_room = do_users_share_a_room
|
||||
self.datastore.user_rooms_intersect = user_rooms_intersect
|
||||
|
||||
self.handlers = hs.get_handlers()
|
||||
|
||||
|
|
Loading…
Reference in a new issue