mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 14:34:47 -04:00
Also support remote users on the joined_rooms admin API. (#8948)
For remote users, only the rooms which the server knows about are returned. Local users have all of their joined rooms returned.
This commit is contained in:
parent
c9195744a4
commit
b161528fcc
4 changed files with 57 additions and 13 deletions
|
@ -714,13 +714,6 @@ class UserMembershipRestServlet(RestServlet):
|
|||
async def on_GET(self, request, user_id):
|
||||
await assert_requester_is_admin(self.auth, request)
|
||||
|
||||
if not self.is_mine(UserID.from_string(user_id)):
|
||||
raise SynapseError(400, "Can only lookup local users")
|
||||
|
||||
user = await self.store.get_user_by_id(user_id)
|
||||
if user is None:
|
||||
raise NotFoundError("Unknown user")
|
||||
|
||||
room_ids = await self.store.get_rooms_for_user(user_id)
|
||||
ret = {"joined_rooms": list(room_ids), "total": len(room_ids)}
|
||||
return 200, ret
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue