diff options
author | Erik Johnston <erik@matrix.org> | 2016-05-04 11:28:10 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-05-04 11:28:10 +0100 |
commit | 984d4a2c0f59039a623b6a6f1945ff697f004c27 (patch) | |
tree | 1c9747dbc5a599030bb17ae1f112ae61408daec6 /synapse/storage/room.py | |
parent | Merge pull request #758 from matrix-org/dbkr/fix_password_reset (diff) | |
download | synapse-984d4a2c0f59039a623b6a6f1945ff697f004c27.tar.xz |
Add /report endpoint
Diffstat (limited to 'synapse/storage/room.py')
-rw-r--r-- | synapse/storage/room.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/storage/room.py b/synapse/storage/room.py index 70aa64fb31..ceced7d516 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,16 @@ 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): + return self._simple_insert( + table="event_reports", + values={ + "room_id": room_id, + "event_id": event_id, + "user_id": user_id, + "reason": reason, + "content": json.dumps(content), + }, + desc="add_event_report" + ) |