aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-status-icon.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-07-06 19:56:55 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-07-07 16:03:37 +0800
commit3103575b755da0765275fb3b774e2e8f8a88bd46 (patch)
tree7b415fa9c4cffa56e09ac3ed2fe9d8113d9fb72b /src/empathy-status-icon.c
parentac6f56a439647386c15fdd6045c00b914f4975f9 (diff)
downloadgsoc2013-empathy-3103575b755da0765275fb3b774e2e8f8a88bd46.tar
gsoc2013-empathy-3103575b755da0765275fb3b774e2e8f8a88bd46.tar.gz
gsoc2013-empathy-3103575b755da0765275fb3b774e2e8f8a88bd46.tar.bz2
gsoc2013-empathy-3103575b755da0765275fb3b774e2e8f8a88bd46.tar.lz
gsoc2013-empathy-3103575b755da0765275fb3b774e2e8f8a88bd46.tar.xz
gsoc2013-empathy-3103575b755da0765275fb3b774e2e8f8a88bd46.tar.zst
gsoc2013-empathy-3103575b755da0765275fb3b774e2e8f8a88bd46.zip
factor out add_notification_actions
Diffstat (limited to 'src/empathy-status-icon.c')
-rw-r--r--src/empathy-status-icon.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c
index b1a0cd685..1e9c8679f 100644
--- a/src/empathy-status-icon.c
+++ b/src/empathy-status-icon.c
@@ -119,6 +119,20 @@ notification_action_cb (NotifyNotification *notification,
}
static void
+add_notification_actions (EmpathyStatusIcon *self,
+ NotifyNotification *notification)
+{
+ EmpathyStatusIconPriv *priv = GET_PRIV (self);
+
+ if (priv->event->type ==EMPATHY_EVENT_TYPE_PRESENCE)
+ return;
+
+ notify_notification_add_action (notification,
+ "respond", _("Respond"), (NotifyActionCallback) notification_action_cb,
+ self, NULL);
+}
+
+static void
status_icon_update_notification (EmpathyStatusIcon *icon)
{
EmpathyStatusIconPriv *priv = GET_PRIV (icon);
@@ -172,15 +186,8 @@ status_icon_update_notification (EmpathyStatusIcon *icon)
}
if (empathy_notify_manager_has_capability (priv->notify_mgr,
- EMPATHY_NOTIFY_MANAGER_CAP_ACTIONS) &&
- priv->event->type != EMPATHY_EVENT_TYPE_PRESENCE) {
- notify_notification_add_action (notification,
- "respond",
- _("Respond"),
- (NotifyActionCallback) notification_action_cb,
- icon,
- NULL);
- }
+ EMPATHY_NOTIFY_MANAGER_CAP_ACTIONS))
+ add_notification_actions (icon, notification);
g_signal_connect (notification, "closed",
G_CALLBACK (status_icon_notification_closed_cb), icon);