forked from Elara6331/itd
Notification: Rework priority and position of sender, summary, and body
Specifically, put the summary in the sender position when sender is blank
This commit is contained in:
parent
fca64afbf3
commit
bdbae443ab
11
notifs.go
11
notifs.go
@ -81,12 +81,13 @@ func initNotifRelay(ctx context.Context, dev *infinitime.Device) error {
|
|||||||
body = translit.Transliterate(body, maps...)
|
body = translit.Transliterate(body, maps...)
|
||||||
|
|
||||||
var msg string
|
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
|
msg = body
|
||||||
} else {
|
// If sender doesn't exist, use summary
|
||||||
msg = fmt.Sprintf("%s\n\n%s", summary, body)
|
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)
|
dev.Notify(sender, msg)
|
||||||
|
Loading…
Reference in New Issue
Block a user