Improve message reporting format
This commit is contained in:
parent
ab880148ad
commit
0c7fc7e866
|
@ -78,8 +78,19 @@ func Contact() http.HandlerFunc {
|
||||||
|
|
||||||
// Find this message, and attach it to the report.
|
// Find this message, and attach it to the report.
|
||||||
if msg, err := models.GetMessage(uint64(tableID)); err == nil {
|
if msg, err := models.GetMessage(uint64(tableID)); err == nil {
|
||||||
footer = fmt.Sprintf(
|
var username = "[unavailable]"
|
||||||
"\n\n---\n\nThe reported DM said:\n\n%s",
|
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),
|
markdown.Quotify(msg.Message),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user