reformat report formatting

I manually expanded the HTML into a more readable format, the rest was
rustfmt's doing. It's beyond me why/how someone would willing write a
pile of HTML like that...
This commit is contained in:
Charles Hall 2024-05-16 17:15:30 -07:00
parent 6bc17b268c
commit 40d6ce230d
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF

View file

@ -35,24 +35,50 @@ pub(crate) async fn report_event_route(
)); ));
}; };
services().admin services()
.admin
.send_message(message::RoomMessageEventContent::text_html( .send_message(message::RoomMessageEventContent::text_html(
format!( format!(
"Report received from: {}\n\n\ "Report received from: {}\n\nEvent ID: {:?}\nRoom ID: {:?}\nSent \
Event ID: {:?}\n\ By: {:?}\n\nReport Score: {:?}\nReport Reason: {:?}",
Room ID: {:?}\n\
Sent By: {:?}\n\n\
Report Score: {:?}\n\
Report Reason: {:?}",
sender_user, pdu.event_id, pdu.room_id, pdu.sender, body.score, body.reason sender_user, pdu.event_id, pdu.room_id, pdu.sender, body.score, body.reason
), ),
format!( format!(
"<details><summary>Report received from: <a href=\"https://matrix.to/#/{0:?}\">{0:?}\ r#"
</a></summary><ul><li>Event Info<ul><li>Event ID: <code>{1:?}</code>\ <details>
<a href=\"https://matrix.to/#/{2:?}/{1:?}\">🔗</a></li><li>Room ID: <code>{2:?}</code>\ <summary>
</li><li>Sent By: <a href=\"https://matrix.to/#/{3:?}\">{3:?}</a></li></ul></li><li>\ Report received from:
Report Info<ul><li>Report Score: {4:?}</li><li>Report Reason: {5}</li></ul></li>\ <a href="https://matrix.to/#/{0:?}">{0:?}</a>
</ul></details>", </summary>
<ul>
<li>
Event Info
<ul>
<li>
Event ID:
<code>{1:?}</code>
<a href="https://matrix.to/#/{2:?}/{1:?}">🔗</a>
</li>
<li>
Room ID:
<code>{2:?}</code>
</li>
<li>
Sent By:
<a href="https://matrix.to/#/{3:?}">{3:?}</a>
</li>
</ul>
</li>
<li>
Report Info
<ul>
<li>Report Score: {4:?}</li>
<li>Report Reason: {5}</li>
</ul>
</li>
</ul>
</details>
"#,
sender_user, sender_user,
pdu.event_id, pdu.event_id,
pdu.room_id, pdu.room_id,