From bdbae443ab00b85826d19f599b5fb19d445e6a27 Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Fri, 23 Sep 2022 00:04:50 -0400 Subject: [PATCH] Notification: Rework priority and position of sender, summary, and body Specifically, put the summary in the sender position when sender is blank --- notifs.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/notifs.go b/notifs.go index 669a52c..2bca484 100644 --- a/notifs.go +++ b/notifs.go @@ -81,12 +81,13 @@ func initNotifRelay(ctx context.Context, dev *infinitime.Device) error { body = translit.Transliterate(body, maps...) var msg string - // If summary does not exist, set message to body. - // If it does, set message to summary, two newlines, and then body - if summary == "" { - msg = body - } else { - msg = fmt.Sprintf("%s\n\n%s", summary, body) + msg = body + // If sender doesn't exist, use summary + if sender == "" { + sender = summary + // if all three exist, set message to summary and body + } else if summary != "" { + msg = fmt.Sprintf("%s\n%s", summary, body) } dev.Notify(sender, msg)