mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-07-31 20:18:35 -04:00
Add /report endpoint
This commit is contained in:
parent
56aae0eaf5
commit
984d4a2c0f
5 changed files with 99 additions and 1 deletions
|
@ -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"
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue