]> git.0d.be Git - empathy.git/commitdiff
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 e6ddb1808d0d29c226f50a08415264e2bc271deb..9d2997096a6e75f57443cc6eabc9ee839ab6b5f5 100644 (file)
@@ -318,10 +318,22 @@ event_manager_pendings_changed_cb (EmpathyContactList  *list,
                                   gboolean             is_pending,
                                   EmpathyEventManager *manager)
 {
                                   gboolean             is_pending,
                                   EmpathyEventManager *manager)
 {
-       GString *str;
+       EmpathyEventManagerPriv *priv = GET_PRIV (manager);
+       GString                 *str;
 
        if (!is_pending) {
 
        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;
        }
 
                return;
        }