Merge pull request #699 from tsipinakis/invalidate_actions

Invalidate actions after notification is closed
This commit is contained in:
Benedikt Heine 2020-03-31 16:43:29 +02:00 committed by GitHub
commit ef88e39de6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);
/**