diff --git a/notification.c b/notification.c index a345386..15973fe 100644 --- a/notification.c +++ b/notification.c @@ -313,6 +313,14 @@ int notification_init(notification * n, int id) n->msg = g_strstrip(n->msg); + if (id == 0) { + n->id = ++next_notification_id; + } else { + notification_close_by_id(id, -1); + n->id = id; + + } + n->dup_count = 0; /* check if n is a duplicate */ @@ -402,13 +410,6 @@ int notification_init(notification * n, int id) n->first_render = true; - if (id == 0) { - n->id = ++next_notification_id; - } else { - notification_close_by_id(id, -1); - n->id = id; - } - if (strlen(n->msg) == 0) { notification_close(n, 2); printf("skipping notification: %s %s\n", n->body, n->summary);