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
This commit is contained in:
Nikos Tsipinakis 2017-01-16 17:46:06 +02:00
parent f0ca0c8e6b
commit c4a002bc79

View File

@ -389,6 +389,15 @@ int notification_init(notification * n, int id)
n->msg = g_strchomp(n->msg); 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) { if (id == 0) {
n->id = ++next_notification_id; n->id = ++next_notification_id;
} else { } else {
@ -467,15 +476,6 @@ int notification_init(notification * n, int id)
n->timeout == -1 ? settings.timeouts[n->urgency] : n->timeout; n->timeout == -1 ? settings.timeouts[n->urgency] : n->timeout;
n->start = 0; 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->timestamp = time(NULL);
n->redisplayed = false; n->redisplayed = false;