Improve message reporting format

This commit is contained in:
Noah Petherbridge 2024-09-26 21:05:27 -07:00
parent ab880148ad
commit 0c7fc7e866

View File

@ -78,8 +78,19 @@ func Contact() http.HandlerFunc {
// Find this message, and attach it to the report.
if msg, err := models.GetMessage(uint64(tableID)); err == nil {
footer = fmt.Sprintf(
"\n\n---\n\nThe reported DM said:\n\n%s",
var username = "[unavailable]"
if sender, err := models.GetUser(msg.SourceUserID); err == nil {
username = sender.Username
}
footer = fmt.Sprintf(`
---
From: <a href="/u/%s">@%s</a>
%s`,
username, username,
markdown.Quotify(msg.Message),
)
}