diff options
author | Erik Johnston <erik@matrix.org> | 2016-03-23 13:19:26 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-03-23 13:19:26 +0000 |
commit | 2749da542cf0d2e7bd78800f98356635a05b9620 (patch) | |
tree | a585faac772a90be0397fccc0b1fb23d765a8aeb /synapse/storage | |
parent | Merge pull request #665 from matrix-org/erikj/dont_cache_events (diff) | |
parent | Make get_invites return RoomsForUser (diff) | |
download | synapse-2749da542cf0d2e7bd78800f98356635a05b9620.tar.xz |
Merge pull request #663 from matrix-org/erikj/invite_for_user
Make get_invites return RoomsForUser
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/roommember.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py index 0cd89260f2..430b49c12e 100644 --- a/synapse/storage/roommember.py +++ b/synapse/storage/roommember.py @@ -115,19 +115,17 @@ class RoomMemberStore(SQLBaseStore): ).addCallback(self._get_events) @cached() - def get_invites_for_user(self, user_id): - """ Get all the invite events for a user + def get_invited_rooms_for_user(self, user_id): + """ Get all the rooms the user is invited to Args: user_id (str): The user ID. Returns: - A deferred list of event objects. + A deferred list of RoomsForUser. """ return self.get_rooms_for_user_where_membership_is( user_id, [Membership.INVITE] - ).addCallback(lambda invites: self._get_events([ - invite.event_id for invite in invites - ])) + ) def get_leave_and_ban_events_for_user(self, user_id): """ Get all the leave events for a user |