diff options
author | Erik Johnston <erik@matrix.org> | 2014-09-25 18:21:00 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-09-25 18:21:00 +0100 |
commit | 697f6714a4c65cec6019231a7bac84e1b544c42d (patch) | |
tree | 8693ec59f906c076abb534f01c32573619bf7c8c /synapse/storage/room.py | |
parent | Bump versions and changelog (diff) | |
parent | Just use a yaml list for turn servers (diff) | |
download | synapse-697f6714a4c65cec6019231a7bac84e1b544c42d.tar.xz |
Merge branch 'release-v0.3.4' of github.com:matrix-org/synapse v0.3.4
Diffstat (limited to 'synapse/storage/room.py')
-rw-r--r-- | synapse/storage/room.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/synapse/storage/room.py b/synapse/storage/room.py index 5adf8cdf1b..8cd46334cf 100644 --- a/synapse/storage/room.py +++ b/synapse/storage/room.py @@ -27,7 +27,7 @@ import logging logger = logging.getLogger(__name__) -OpsLevel = collections.namedtuple("OpsLevel", ("ban_level", "kick_level")) +OpsLevel = collections.namedtuple("OpsLevel", ("ban_level", "kick_level", "redact_level")) class RoomStore(SQLBaseStore): @@ -189,7 +189,8 @@ class RoomStore(SQLBaseStore): def _get_ops_levels(self, txn, room_id): sql = ( - "SELECT ban_level, kick_level FROM room_ops_levels as r " + "SELECT ban_level, kick_level, redact_level " + "FROM room_ops_levels as r " "INNER JOIN current_state_events as c " "ON r.event_id = c.event_id " "WHERE c.room_id = ? " @@ -198,7 +199,7 @@ class RoomStore(SQLBaseStore): rows = txn.execute(sql, (room_id,)).fetchall() if len(rows) == 1: - return OpsLevel(rows[0][0], rows[0][1]) + return OpsLevel(rows[0][0], rows[0][1], rows[0][2]) else: return OpsLevel(None, None) @@ -326,6 +327,9 @@ class RoomStore(SQLBaseStore): if "ban_level" in event.content: content["ban_level"] = event.content["ban_level"] + if "redact_level" in event.content: + content["redact_level"] = event.content["redact_level"] + self._simple_insert_txn( txn, "room_ops_levels", |