diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-03-29 15:48:22 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-04-02 06:04:21 +0800 |
commit | dfc65cb90ac55e7b84a4213356dbaec9a6ec6b9a (patch) | |
tree | 2df6f4664b4387da0ed916ba424cb03b1f35f67a | |
parent | ae4b21495c6a89feab8733f5dcd0480e54f2a69d (diff) | |
download | gsoc2013-empathy-dfc65cb90ac55e7b84a4213356dbaec9a6ec6b9a.tar gsoc2013-empathy-dfc65cb90ac55e7b84a4213356dbaec9a6ec6b9a.tar.gz gsoc2013-empathy-dfc65cb90ac55e7b84a4213356dbaec9a6ec6b9a.tar.bz2 gsoc2013-empathy-dfc65cb90ac55e7b84a4213356dbaec9a6ec6b9a.tar.lz gsoc2013-empathy-dfc65cb90ac55e7b84a4213356dbaec9a6ec6b9a.tar.xz gsoc2013-empathy-dfc65cb90ac55e7b84a4213356dbaec9a6ec6b9a.tar.zst gsoc2013-empathy-dfc65cb90ac55e7b84a4213356dbaec9a6ec6b9a.zip |
set urgency hint on urgent notifications
This will ensure that they stay visible in the Shell and that their actions
buttons are displayed as well (#645932).
-rw-r--r-- | src/empathy-notifications-approver.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/empathy-notifications-approver.c b/src/empathy-notifications-approver.c index e0d540cdc..9f1774ae4 100644 --- a/src/empathy-notifications-approver.c +++ b/src/empathy-notifications-approver.c @@ -222,6 +222,28 @@ add_notification_actions (EmpathyNotificationsApprover *self, } } +static gboolean +notification_is_urgent (EmpathyNotificationsApprover *self, + NotifyNotification *notification) +{ + /* Mark as urgent all the notifications with which user should + * interact ASAP */ + switch (self->priv->event->type) { + case EMPATHY_EVENT_TYPE_CHAT: + case EMPATHY_EVENT_TYPE_VOIP: + case EMPATHY_EVENT_TYPE_TRANSFER: + case EMPATHY_EVENT_TYPE_INVITATION: + case EMPATHY_EVENT_TYPE_AUTH: + return TRUE; + + case EMPATHY_EVENT_TYPE_SUBSCRIPTION: + case EMPATHY_EVENT_TYPE_PRESENCE: + return FALSE; + } + + return FALSE; +} + static void update_notification (EmpathyNotificationsApprover *self) { @@ -288,6 +310,9 @@ update_notification (EmpathyNotificationsApprover *self) if (empathy_notify_manager_has_capability (self->priv->notify_mgr, EMPATHY_NOTIFY_MANAGER_CAP_ACTIONS)) add_notification_actions (self, notification); + + if (notification_is_urgent (self, notification)) + notify_notification_set_urgency (notification, NOTIFY_URGENCY_CRITICAL); } pixbuf = empathy_notify_manager_get_pixbuf_for_notification ( |