Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Add new room membership APIs #1680

Merged
merged 3 commits into from
Dec 9, 2016
Merged

Add new room membership APIs #1680

merged 3 commits into from
Dec 9, 2016

Conversation

erikjohnston
Copy link
Member

@erikjohnston erikjohnston commented Dec 8, 2016

Add two new APIs:

  • /joined_rooms that returns the list of rooms the user is in
  • /rooms/<room_id>/joined_members that returns the list of currently joined users and their profile data

These are primarily designed for ASes that may want to efficiently look up those pieces of information without otherwise needing to do a full /sync


Example output:

GET /joined_rooms

{"joined_rooms": ["!foo:example.com"]}
GET /rooms/!foo:example.com/joined_members

{"joined": {"@bar:example.com": { "display_name": "Bar", "avatar_url": null }}}

This returns the currently joined members in the room with their display
names and avatar urls. This is more efficient than /members for large
rooms where you don't need the full events.
@erikjohnston
Copy link
Member Author

matrix-org/sytest#329

Copy link
Contributor

@NegativeMjark NegativeMjark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@leonerd
Copy link
Contributor

leonerd commented Dec 12, 2016

I admit it's probably a bit late now, but is there any reason why

{"joined": {"@bar:example.com": { "display_name": "Bar", "avatar_url": null }}}

the toplevel key is joined? This is neither the last component of the URI (joined_members), nor is it the actual membership string value (which would be join).

@t3chguy
Copy link
Member

t3chguy commented Oct 2, 2017

Correction: GET /rooms/!foo:example.com/joined_members
s/room/rooms/

@richvdh
Copy link
Member

richvdh commented Feb 20, 2018

updated, thanks @t3chguy

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants