mirror of
https://github.com/element-hq/synapse
synced 2024-08-19 22:00:22 +00:00
Comments
This commit is contained in:
parent
3727d66a0e
commit
2687af82d4
3 changed files with 12 additions and 2 deletions
|
@ -343,7 +343,14 @@ class DirectoryHandler(BaseHandler):
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def edit_published_appservice_room_list(self, appservice_id, network_id,
|
def edit_published_appservice_room_list(self, appservice_id, network_id,
|
||||||
room_id, visibility):
|
room_id, visibility):
|
||||||
"""Edit the appservice/network specific public room list.
|
"""Add or remove a room from the appservice/network specific public
|
||||||
|
room list.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
appservice_id (str): ID of the appservice that owns the list
|
||||||
|
network_id (str): The ID of the network the list is associated with
|
||||||
|
room_id (str)
|
||||||
|
visibility (str): either "public" or "private"
|
||||||
"""
|
"""
|
||||||
if visibility not in ["public", "private"]:
|
if visibility not in ["public", "private"]:
|
||||||
raise SynapseError(400, "Invalid visibility setting")
|
raise SynapseError(400, "Invalid visibility setting")
|
||||||
|
|
|
@ -63,7 +63,8 @@ class RoomListHandler(BaseHandler):
|
||||||
Setting to None returns all public rooms across all lists.
|
Setting to None returns all public rooms across all lists.
|
||||||
"""
|
"""
|
||||||
if search_filter or network_tuple is not (None, None):
|
if search_filter or network_tuple is not (None, None):
|
||||||
# We explicitly don't bother caching searches.
|
# We explicitly don't bother caching searches or requests for
|
||||||
|
# appservice specific lists.
|
||||||
return self._get_public_room_list(
|
return self._get_public_room_list(
|
||||||
limit, since_token, search_filter, network_tuple=network_tuple,
|
limit, since_token, search_filter, network_tuple=network_tuple,
|
||||||
)
|
)
|
||||||
|
|
|
@ -19,6 +19,8 @@ CREATE TABLE appservice_room_list(
|
||||||
room_id TEXT NOT NULL
|
room_id TEXT NOT NULL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
-- Each appservice can have multiple published room lists associated with them,
|
||||||
|
-- keyed of a particular network_id
|
||||||
CREATE UNIQUE INDEX appservice_room_list_idx ON appservice_room_list(
|
CREATE UNIQUE INDEX appservice_room_list_idx ON appservice_room_list(
|
||||||
appservice_id, network_id, room_id
|
appservice_id, network_id, room_id
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue