move id replace before stack_duplicates logic

This commit is contained in:
nopjmp 2014-06-16 21:14:03 -05:00
parent f48d512223
commit 788bd964d7

View File

@ -313,6 +313,14 @@ int notification_init(notification * n, int id)
n->msg = g_strstrip(n->msg); 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; n->dup_count = 0;
/* check if n is a duplicate */ /* check if n is a duplicate */
@ -402,13 +410,6 @@ int notification_init(notification * n, int id)
n->first_render = true; 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) { if (strlen(n->msg) == 0) {
notification_close(n, 2); notification_close(n, 2);
printf("skipping notification: %s %s\n", n->body, n->summary); printf("skipping notification: %s %s\n", n->body, n->summary);