Skip to content
Snippets Groups Projects
Verified Commit f741afb2 authored by sistason's avatar sistason
Browse files

get room_type from db. Test if it works and then remove the 'if channel if group' etc

parent 99630d52
No related branches found
No related tags found
No related merge requests found
Pipeline #11200 passed
......@@ -18,6 +18,7 @@ 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 }}
All: {{ baseurl }}/{{ room_type }}/{{ room_name }}?msg={{ report.message._id }}
-- description --
{{ report.description|d("<none>")|indent(first=true) }}
......@@ -36,8 +37,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