diff options
author | Erik Johnston <erik@matrix.org> | 2018-08-17 14:15:48 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-08-17 14:15:48 +0100 |
commit | 782689bd408b7d291fef913a318e1a6dda6f13e1 (patch) | |
tree | 50502568cd0b9966e8c42d48d8db5d6cdf73fe1c /synapse/storage/room.py | |
parent | Split ProfileHandler into master and worker (diff) | |
parent | Merge pull request #3708 from matrix-org/neilj/resource_Limit_block_event_cre... (diff) | |
download | synapse-782689bd408b7d291fef913a318e1a6dda6f13e1.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/split_profiles
Diffstat (limited to 'synapse/storage/room.py')
-rw-r--r-- | synapse/storage/room.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/synapse/storage/room.py b/synapse/storage/room.py index 1e473cc188..61013b8919 100644 --- a/synapse/storage/room.py +++ b/synapse/storage/room.py @@ -41,6 +41,22 @@ RatelimitOverride = collections.namedtuple( class RoomWorkerStore(SQLBaseStore): + def get_room(self, room_id): + """Retrieve a room. + + Args: + room_id (str): The ID of the room to retrieve. + Returns: + A namedtuple containing the room information, or an empty list. + """ + return self._simple_select_one( + table="rooms", + keyvalues={"room_id": room_id}, + retcols=("room_id", "is_public", "creator"), + desc="get_room", + allow_none=True, + ) + def get_public_room_ids(self): return self._simple_select_onecol( table="rooms", @@ -244,22 +260,6 @@ class RoomStore(RoomWorkerStore, SearchStore): logger.error("store_room with room_id=%s failed: %s", room_id, e) raise StoreError(500, "Problem creating room.") - def get_room(self, room_id): - """Retrieve a room. - - Args: - room_id (str): The ID of the room to retrieve. - Returns: - A namedtuple containing the room information, or an empty list. - """ - return self._simple_select_one( - table="rooms", - keyvalues={"room_id": room_id}, - retcols=("room_id", "is_public", "creator"), - desc="get_room", - allow_none=True, - ) - @defer.inlineCallbacks def set_room_is_public(self, room_id, is_public): def set_room_is_public_txn(txn, next_id): |