]> git.0d.be Git - empathy.git/commitdiff
factor out add_notification_actions
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 6 Jul 2010 11:56:55 +0000 (13:56 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 7 Jul 2010 08:03:37 +0000 (10:03 +0200)
src/empathy-status-icon.c

index b1a0cd685ed51129d2083a31d589d500cce9f074..1e9c8679fdc1d290da55a51f239371e047d17b51 100644 (file)
@@ -118,6 +118,20 @@ notification_action_cb (NotifyNotification *notification,
                empathy_event_activate (priv->event);
 }
 
+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)
 {
@@ -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);