Compare commits
1 Commits
v0.0.8
...
notif-send
| Author | SHA1 | Date | |
|---|---|---|---|
| bdbae443ab |
13
notifs.go
13
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.
|
msg = body
|
||||||
// If it does, set message to summary, two newlines, and then body
|
// If sender doesn't exist, use summary
|
||||||
if summary == "" {
|
if sender == "" {
|
||||||
msg = body
|
sender = summary
|
||||||
} else {
|
// if all three exist, set message to summary and body
|
||||||
msg = fmt.Sprintf("%s\n\n%s", summary, body)
|
} else if summary != "" {
|
||||||
|
msg = fmt.Sprintf("%s\n%s", summary, body)
|
||||||
}
|
}
|
||||||
|
|
||||||
dev.Notify(sender, msg)
|
dev.Notify(sender, msg)
|
||||||
|
|||||||
Reference in New Issue
Block a user