From a21edbe974d41e5c100da0a2d623aa7280ed12b5 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Mon, 29 Apr 2024 18:11:46 +0200 Subject: [PATCH] Make notification icon optional --- notification/notification.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/notification/notification.go b/notification/notification.go index b0473bd..f01a889 100644 --- a/notification/notification.go +++ b/notification/notification.go @@ -44,7 +44,11 @@ func Add(id uint, content Content) error { data := map[string]dbus.Variant{ "title": convert.FromString(content.Title), "body": convert.FromString(content.Body), - "icon": convert.FromString(content.Icon), + } + + // Only add the icon field when it is set + if content.Icon != "" { + data["icon"] = convert.FromString(content.Icon) } // Only add the priority field when it is set.