diff options
author | Erik Johnston <erik@matrix.org> | 2016-05-06 15:59:20 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-05-06 15:59:20 +0100 |
commit | 012cb5416cded6453e676696d74cab871db4aaf8 (patch) | |
tree | 71f21e4d6d4a6fd4037cfbf0a200667d29f46247 /synapse/storage/room.py | |
parent | Delete old pushers (diff) | |
parent | Merge pull request #767 from matrix-org/erikj/transaction_txn (diff) | |
download | synapse-012cb5416cded6453e676696d74cab871db4aaf8.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/push_actions_delete
Diffstat (limited to 'synapse/storage/room.py')
-rw-r--r-- | synapse/storage/room.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/synapse/storage/room.py b/synapse/storage/room.py index 70aa64fb31..26933e593a 100644 --- a/synapse/storage/room.py +++ b/synapse/storage/room.py @@ -23,6 +23,7 @@ from .engines import PostgresEngine, Sqlite3Engine import collections import logging +import ujson as json logger = logging.getLogger(__name__) @@ -221,3 +222,20 @@ class RoomStore(SQLBaseStore): aliases.extend(e.content['aliases']) defer.returnValue((name, aliases)) + + def add_event_report(self, room_id, event_id, user_id, reason, content, + received_ts): + next_id = self._event_reports_id_gen.get_next() + return self._simple_insert( + table="event_reports", + values={ + "id": next_id, + "received_ts": received_ts, + "room_id": room_id, + "event_id": event_id, + "user_id": user_id, + "reason": reason, + "content": json.dumps(content), + }, + desc="add_event_report" + ) |