Skip to content
Snippets Groups Projects
Verified Commit 1029b050 authored by nd's avatar nd
Browse files

Merge branch 'main' of git.cccv.de:/infra/packages/rocketchat-reporting

parents 343b613c f741afb2
No related branches found
No related tags found
No related merge requests found
Pipeline #12103 passed
......@@ -14,10 +14,7 @@ def main():
{{ reporter[0].username|d("<unknown>") }} sent a new report about a message from the user {{ report.message.u.username|d("<unknown>") }} .
Time: {{ report.ts }}
URL to message:
If channel: {{ baseurl }}/channel/{{ report.message.rid }}?msg={{ report.message._id }}
If group: {{ baseurl }}/group/{{ report.message.rid }}?msg={{ report.message._id }}
If dm: {{ baseurl }}/direct/{{ report.message.rid }}?msg={{ report.message._id }}
URL to message: {{ baseurl }}/{{ room_type }}/{{ room_name }}?msg={{ report.message._id }}
-- description --
{{ report.description|d("<none>")|indent(first=true) }}
......@@ -36,8 +33,14 @@ URL to message:
db = client.rocketchat
reports = db.get_collection('rocketchat_reports').find({})
ROOM_TYPES = {"c": "channel", "d": "direct", "p": "group"}
for report in reports:
reporter = db.get_collection('users').find({'_id': report.get('userId')})
room = db.get_collection("rocketchat_room").find_one({"_id": report.get("message").get("rid")})
room_type = ROOM_TYPES.get(room.get("t"))
room_name = room.get("name")
msg = EmailMessage()
msg['Message-ID'] = make_msgid()
msg['Date'] = formatdate(localtime = 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment