mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Merge pull request #2130 from APwhitehat/roomexists
Check that requested room_id exists
This commit is contained in:
commit
d3c150411c
@ -39,6 +39,7 @@ class ClientDirectoryServer(ClientV1RestServlet):
|
|||||||
|
|
||||||
def __init__(self, hs):
|
def __init__(self, hs):
|
||||||
super(ClientDirectoryServer, self).__init__(hs)
|
super(ClientDirectoryServer, self).__init__(hs)
|
||||||
|
self.store = hs.get_datastore()
|
||||||
self.handlers = hs.get_handlers()
|
self.handlers = hs.get_handlers()
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
@ -70,7 +71,10 @@ class ClientDirectoryServer(ClientV1RestServlet):
|
|||||||
logger.debug("Got servers: %s", servers)
|
logger.debug("Got servers: %s", servers)
|
||||||
|
|
||||||
# TODO(erikj): Check types.
|
# TODO(erikj): Check types.
|
||||||
# TODO(erikj): Check that room exists
|
|
||||||
|
room = yield self.store.get_room(room_id)
|
||||||
|
if room is None:
|
||||||
|
raise SynapseError(400, "Room does not exist")
|
||||||
|
|
||||||
dir_handler = self.handlers.directory_handler
|
dir_handler = self.handlers.directory_handler
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user