Add new room membership APIs #1680

Merged
merged 3 commits into from Dec 9, 2016

Projects

None yet

3 participants

@erikjohnston
Member
erikjohnston commented Dec 8, 2016 edited

Add two new APIs:

  • /joined_rooms that returns the list of rooms the user is in
  • /room/<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 /room/!foo:example.com/joined_members

{"joined": {"@bar:example.com": { "display_name": "Bar", "avatar_url": null }}}
erikjohnston added some commits Dec 8, 2016
@erikjohnston erikjohnston Add joined_rooms servlet de796f2
@erikjohnston erikjohnston Add profile data to the room_membership table for joins c45d8e9
@erikjohnston erikjohnston Add /room/<room_id>/joined_members API
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.
52d12ca
@erikjohnston erikjohnston requested a review from NegativeMjark Dec 8, 2016
@erikjohnston erikjohnston referenced this pull request in matrix-org/matrix-doc Dec 8, 2016
Open

API to enquire what rooms I'm a member of #734

@NegativeMjark

LGTM

@erikjohnston erikjohnston merged commit 1697f6a into develop Dec 9, 2016

10 of 12 checks passed

Sytest Dendron (Commit) Build #1219 origin/erikj/joined_rooms failed in 1 min 20 sec
Details
Sytest Dendron (Merged PR) Build finished.
Details
Flake8 + Packaging (Commit) Build #2164 origin/erikj/joined_rooms succeeded in 49 sec
Details
Flake8 + Packaging (Merged PR) Build finished.
Details
Sytest Postgres (Commit) Build #2060 origin/erikj/joined_rooms succeeded in 7 min 44 sec
Details
Sytest Postgres (Merged PR) Build finished.
Details
Sytest SQLite (Commit) Build #2103 origin/erikj/joined_rooms succeeded in 6 min 56 sec
Details
Sytest SQLite (Merged PR) Build finished.
Details
Unit Tests (Commit) Build #2188 origin/erikj/joined_rooms succeeded in 3 min 5 sec
Details
Unit Tests (Merged PR) Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@Kegsay Kegsay added a commit to matrix-org/matrix-appservice-bridge that referenced this pull request Dec 12, 2016
@Kegsay Kegsay Implement new membership list APIs
matrix-org/synapse#1680
 - `/joined_rooms`
 - `/rooms/$room_id/joined_members`
876f40d
@Kegsay Kegsay referenced this pull request in matrix-org/matrix-appservice-bridge Dec 12, 2016
Merged

Implement new membership list APIs #45

@leonerd
Member
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).

@leonerd leonerd referenced this pull request in matrix-org/sytest Dec 12, 2016
Merged

Tests for new "room members" APIs #332

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment