From c4a002bc79929a207c7a8b532d19fb868784d8e7 Mon Sep 17 00:00:00 2001 From: Nikos Tsipinakis Date: Mon, 16 Jan 2017 17:46:06 +0200 Subject: [PATCH] Initialise default icon before checking for duplicates Since we are also comparing the icons, the icon path should be set before the duplicate check is done --- src/notification.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/notification.c b/src/notification.c index e1e74d3..5f0f43c 100644 --- a/src/notification.c +++ b/src/notification.c @@ -389,6 +389,15 @@ int notification_init(notification * n, int id) n->msg = g_strchomp(n->msg); + if (n->icon != NULL && strlen(n->icon) <= 0) { + free(n->icon); + n->icon = NULL; + } + + if (n->raw_icon == NULL && n->icon == NULL) { + n->icon = strdup(settings.icons[n->urgency]); + } + if (id == 0) { n->id = ++next_notification_id; } else { @@ -467,15 +476,6 @@ int notification_init(notification * n, int id) n->timeout == -1 ? settings.timeouts[n->urgency] : n->timeout; n->start = 0; - if (n->icon != NULL && strlen(n->icon) <= 0) { - free(n->icon); - n->icon = NULL; - } - - if (n->raw_icon == NULL && n->icon == NULL) { - n->icon = strdup(settings.icons[n->urgency]); - } - n->timestamp = time(NULL); n->redisplayed = false;