don't increment dup_count when progess differs
work around the fact that notify-send doesn't expose the replaces-id.
This commit is contained in:
parent
5cd2b26d0f
commit
0ccd06faf3
@ -321,7 +321,14 @@ int notification_init(notification * n, int id)
|
|||||||
if (strcmp(orig->appname, n->appname) == 0
|
if (strcmp(orig->appname, n->appname) == 0
|
||||||
&& strcmp(orig->summary, n->summary) == 0
|
&& strcmp(orig->summary, n->summary) == 0
|
||||||
&& strcmp(orig->body, n->body) == 0) {
|
&& strcmp(orig->body, n->body) == 0) {
|
||||||
|
/* If the progress differs this was probably intended to replace the notification
|
||||||
|
* but notify-send was used. So don't increment dup_count in this case
|
||||||
|
*/
|
||||||
|
if (orig->progress == n->progress) {
|
||||||
orig->dup_count++;
|
orig->dup_count++;
|
||||||
|
} else {
|
||||||
|
orig->progress = n->progress;
|
||||||
|
}
|
||||||
/* notifications that differ only in progress hints should be expected equal,
|
/* notifications that differ only in progress hints should be expected equal,
|
||||||
* but we want the latest message, with the latest hint value
|
* but we want the latest message, with the latest hint value
|
||||||
*/
|
*/
|
||||||
@ -344,7 +351,14 @@ int notification_init(notification * n, int id)
|
|||||||
*/
|
*/
|
||||||
free(orig->msg);
|
free(orig->msg);
|
||||||
orig->msg = strdup(n->msg);
|
orig->msg = strdup(n->msg);
|
||||||
|
/* If the progress differs this was probably intended to replace the notification
|
||||||
|
* but notify-send was used. So don't increment dup_count in this case
|
||||||
|
*/
|
||||||
|
if (orig->progress == n->progress) {
|
||||||
orig->dup_count++;
|
orig->dup_count++;
|
||||||
|
} else {
|
||||||
|
orig->progress = n->progress;
|
||||||
|
}
|
||||||
orig->start = time(NULL);
|
orig->start = time(NULL);
|
||||||
notification_free(n);
|
notification_free(n);
|
||||||
wake_up();
|
wake_up();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user