Invalidate actions after notification is closed

This commit is contained in:
Nikos Tsipinakis 2020-03-30 22:49:36 +02:00
parent 43c614559c
commit 69e319c729
3 changed files with 15 additions and 0 deletions

View File

@ -384,6 +384,8 @@ void signal_notification_closed(struct notification *n, enum reason reason)
body,
&err);
notification_invalidate_actions(n);
n->dbus_valid = false;
if (err) {

View File

@ -598,4 +598,8 @@ void notification_do_action(const struct notification *n)
}
}
void notification_invalidate_actions(struct notification *n) {
g_hash_table_remove_all(n->actions);
}
/* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */

View File

@ -191,6 +191,15 @@ void notification_update_text_to_render(struct notification *n);
*/
void notification_do_action(const struct notification *n);
/**
* Remove all client action data from the notification.
*
* This should be called after a notification is closed to avoid showing
* actions that will not work anymore since the client has stopped listening
* for them.
*/
void notification_invalidate_actions(struct notification *n);
const char *notification_urgency_to_string(const enum urgency urgency);
/**