Add new API appservice specific public room list #1676

Merged
merged 7 commits into from Dec 12, 2016

Projects

None yet

3 participants

@erikjohnston
Member
erikjohnston commented Dec 6, 2016 edited

This adds the following:

  • A instance_id field to each instance in the GET /thirdparty/protocols API
  • An API that allows ASes to publish rooms to their own dedicated lists, PUT /directory/list/appservice/$network_id/$room_id
  • Two extra params to POST /publicRooms, third_party_instance_id which returns rooms published to AS instance specific lists, and include_all_networks which if true returns all rooms that have been published to any list. By default it will only return rooms on the main, default list.

https://docs.google.com/document/d/12mVuOT7Qoa49L_PQAPjavoK9c2nalYEFOHxJOmH5j-w/edit?usp=sharing

erikjohnston added some commits Dec 6, 2016
@erikjohnston erikjohnston Add new API appservice specific public room list
f32fb65
@erikjohnston erikjohnston Don't include appservice id
3727d66
synapse/handlers/directory.py
+ def edit_published_appservice_room_list(self, appservice_id, network_id,
+ room_id, visibility):
+ """Edit the appservice/network specific public room list.
+ """
@NegativeMjark
NegativeMjark Dec 6, 2016 Contributor

Could we have some docstring for the parameters here?

synapse/storage/room.py
+ @defer.inlineCallbacks
+ def set_room_is_public_appservice(self, room_id, appservice_id, network_id,
+ is_public):
+ """Edit the appservice/network specific public room list.
@NegativeMjark
NegativeMjark Dec 6, 2016 Contributor

Could we have docstring for what the params are and what this does?

+ room_id TEXT NOT NULL
+);
+
+CREATE UNIQUE INDEX appservice_room_list_idx ON appservice_room_list(
@NegativeMjark
NegativeMjark Dec 6, 2016 Contributor

Maybe add comment on what this table is for?

synapse/handlers/room_list.py
+ appservice and network id to use an appservice specific one.
+ Setting to None returns all public rooms across all lists.
+ """
+ if search_filter or network_tuple is not (None, None):
# We explicitly don't bother caching searches.
@NegativeMjark
NegativeMjark Dec 6, 2016 Contributor

Does the comment need updating if we aren't caching the appservice lists as well?

@NegativeMjark
Contributor

What is an appservice_id look like ooi?

@erikjohnston
Member

What is an appservice_id look like ooi?

e.g. irc-freenode or 9666621b268e14d7b18b110073f07c6e955c60a8c8a5792fd810e9978d1931d7

@erikjohnston erikjohnston Comments
2687af8
@erikjohnston erikjohnston referenced this pull request in matrix-org/sytest Dec 7, 2016
Merged

Test AS specific room lists #328

@erikjohnston
Member

Now with added sytests matrix-org/sytest#328!

@erikjohnston erikjohnston Docstring
d45c984
@lukebarnard1
Contributor

Is it really instance_id? Because I can't see any sign of that in the code...

@erikjohnston
Member

Will probably change it to network_id in the AS layer, and instance_id in the client layer, if that sounds good to you @lukebarnard1 ?

@lukebarnard1 lukebarnard1 added a commit to matrix-org/matrix-js-sdk that referenced this pull request Dec 12, 2016
@lukebarnard1 lukebarnard1 Add setRoomDirectoryVisibilityAppService
This is for setting the publicity of a room that is bridged to a 3rd party network. This change reflects the second bullet point of matrix-org/synapse#1676 (comment).
742d942
erikjohnston added some commits Dec 12, 2016
@erikjohnston erikjohnston Notify replication. Use correct network_id 631376e
@erikjohnston erikjohnston Add cache to get_public_room_ids_at_stream_id
09cbcb7
@NegativeMjark

LGTM

@erikjohnston erikjohnston Rename network_id to instance_id on client side
2bf5a47
@erikjohnston
Member

@matrixbot retest this please

@erikjohnston erikjohnston merged commit 1574b83 into develop Dec 12, 2016

7 of 8 checks passed

Sytest Dendron (Commit) Build #1242 origin/erikj/room_list failed in 1 min 8 sec
Details
Sytest Dendron (Merged PR) Build finished.
Details
Sytest Postgres (Commit) Build #2083 origin/erikj/room_list succeeded in 7 min 5 sec
Details
Sytest Postgres (Merged PR) Build finished.
Details
Sytest SQLite (Commit) Build #2126 origin/erikj/room_list succeeded in 6 min 40 sec
Details
Sytest SQLite (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
@dbkr dbkr added a commit to vector-im/riot-web that referenced this pull request Dec 14, 2016
@dbkr dbkr Support room dir 3rd party network filtering
As per matrix-org/synapse#1676

The existing local config system still exists and is used for
remote home server directories (since /thirdparty/protocols
doesn't support listing remote home servers, and also because
people are using it).
f5bd8ab
@dbkr dbkr referenced this pull request in vector-im/riot-web Dec 14, 2016
Merged

Support room dir 3rd party network filtering #2747

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