From 0c7fc7e86694f9fee308fcf6996973c64244d162 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Thu, 26 Sep 2024 21:05:27 -0700 Subject: [PATCH] Improve message reporting format --- pkg/controller/index/contact.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkg/controller/index/contact.go b/pkg/controller/index/contact.go index c507ab6..849c315 100644 --- a/pkg/controller/index/contact.go +++ b/pkg/controller/index/contact.go @@ -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: @%s + +%s`, + username, username, markdown.Quotify(msg.Message), ) }