'Stores a room.
Args:
room_id (str): The desired room ID, can be None.
room_creator_user_id (str): The user ID of the room creator.
is_public (bool): True to indicate that this room should appear in
public room lists.
Raises:
StoreError if the room could not be stored.'

@defer.inlineCallbacks
def store_room(self, room_id, room_creator_user_id, is_public):

    try:
        def store_room_txn(txn, next_id):
            self._simple_insert_txn(txn, 'rooms', {'room_id': room_id, 'creator': room_creator_user_id, 'is_public': is_public})
            if is_public:
                self._simple_insert_txn(txn, table='public_room_list_stream', values={'stream_id': next_id, 'room_id': room_id, 'visibility': is_public})
        with self._public_room_id_gen.get_next() as next_id:
            (yield self.runInteraction('store_room_txn', store_room_txn, next_id))
    except Exception as e:
        logger.error('store_room    with    room_id=%s    failed:    %s', room_id, e)
        raise StoreError(500, 'Problem    creating    room.')
