Remove the contact pending event when the contact is not pending anymore.
authorXavier Claessens <xclaesse@src.gnome.org>
Tue, 15 Jul 2008 14:00:49 +0000 (14:00 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Tue, 15 Jul 2008 14:00:49 +0000 (14:00 +0000)
svn path=/trunk/; revision=1252

libempathy-gtk/empathy-event-manager.c

index e6ddb18..9d29970 100644 (file)
@@ -318,10 +318,22 @@ event_manager_pendings_changed_cb (EmpathyContactList  *list,
                                   gboolean             is_pending,
                                   EmpathyEventManager *manager)
 {
-       GString *str;
+       EmpathyEventManagerPriv *priv = GET_PRIV (manager);
+       GString                 *str;
 
        if (!is_pending) {
-               /* FIXME: remove event if any */
+               GSList *l;
+
+               for (l = priv->events; l; l = l->next) {
+                       EventPriv *event = l->data;
+
+                       if (event->public.contact == contact &&
+                           event->func == event_pending_subscribe_func) {
+                               event_remove (event);
+                               break;
+                       }
+               }
+
                return;
        }