]> git.0d.be Git - empathy.git/commitdiff
Add 'Respond' button only for text channels and approve it directly
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 6 Jul 2010 12:07:17 +0000 (14:07 +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 1e9c8679fdc1d290da55a51f239371e047d17b51..0f3fff1b78c6e56048e05475d3569d09f73305f7 100644 (file)
@@ -108,14 +108,14 @@ notification_close_helper (EmpathyStatusIconPriv *priv)
 }
 
 static void
-notification_action_cb (NotifyNotification *notification,
+notification_approve_cb (NotifyNotification *notification,
                        gchar              *action,
                        EmpathyStatusIcon  *icon)
 {
        EmpathyStatusIconPriv *priv = GET_PRIV (icon);
 
        if (priv->event)
-               empathy_event_activate (priv->event);
+               empathy_event_approve (priv->event);
 }
 
 static void
@@ -124,12 +124,16 @@ add_notification_actions (EmpathyStatusIcon *self,
 {
        EmpathyStatusIconPriv *priv = GET_PRIV (self);
 
-       if (priv->event->type ==EMPATHY_EVENT_TYPE_PRESENCE)
-               return;
+       switch (priv->event->type) {
+               case EMPATHY_EVENT_TYPE_CHAT:
+                       notify_notification_add_action (notification,
+                               "respond", _("Respond"), (NotifyActionCallback) notification_approve_cb,
+                                       self, NULL);
+                       break;
 
-       notify_notification_add_action (notification,
-               "respond", _("Respond"), (NotifyActionCallback) notification_action_cb,
-               self, NULL);
+               default:
+                       break;
+       }
 }
 
 static void