]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-tp-contact-list.c
Also accept local-pending of publish if adding a contact
[empathy.git] / libempathy / empathy-tp-contact-list.c
index 636f2ed3f89b3c1bd7095f9799b36e7f9836cf20..0237570a0d3e3557bfdecb0fcd957b86dc81bce4 100644 (file)
@@ -334,15 +334,24 @@ tp_contact_list_group_add (EmpathyTpContactList *list,
 
 static void
 tp_contact_list_got_added_members_cb (EmpathyTpContactFactory *factory,
-                                     GList                   *contacts,
+                                     guint                    n_contacts,
+                                     EmpathyContact * const * contacts,
+                                     guint                    n_failed,
+                                     const TpHandle          *failed,
+                                     const GError            *error,
                                      gpointer                 user_data,
                                      GObject                 *list)
 {
        EmpathyTpContactListPriv *priv = GET_PRIV (list);
-       GList *l;
+       guint i;
+
+       if (error) {
+               DEBUG ("Error: %s", error->message);
+               return;
+       }
 
-       for (l = contacts; l; l = l->next) {
-               EmpathyContact *contact = l->data;
+       for (i = 0; i < n_contacts; i++) {
+               EmpathyContact *contact = contacts[i];
                TpHandle handle;
 
                handle = empathy_contact_get_handle (contact);
@@ -367,15 +376,24 @@ tp_contact_list_got_added_members_cb (EmpathyTpContactFactory *factory,
 
 static void
 tp_contact_list_got_local_pending_cb (EmpathyTpContactFactory *factory,
-                                     GList                   *contacts,
-                                     gpointer                 info,
+                                     guint                    n_contacts,
+                                     EmpathyContact * const * contacts,
+                                     guint                    n_failed,
+                                     const TpHandle          *failed,
+                                     const GError            *error,
+                                     gpointer                 user_data,
                                      GObject                 *list)
 {
        EmpathyTpContactListPriv *priv = GET_PRIV (list);
-       GList *l;
+       guint i;
 
-       for (l = contacts; l; l = l->next) {
-               EmpathyContact *contact = l->data;
+       if (error) {
+               DEBUG ("Error: %s", error->message);
+               return;
+       }
+
+       for (i = 0; i < n_contacts; i++) {
+               EmpathyContact *contact = contacts[i];
                TpHandle handle;
                const gchar *message;
                TpChannelGroupChangeReason reason;
@@ -859,6 +877,11 @@ tp_contact_list_add (EmpathyContactList *list,
                tp_cli_channel_interface_group_call_add_members (priv->subscribe,
                        -1, &handles, message, NULL, NULL, NULL, NULL);
        }
+       if (priv->publish &&
+           g_hash_table_lookup (priv->pendings, GUINT_TO_POINTER (handle))) {
+               tp_cli_channel_interface_group_call_add_members (priv->publish,
+                       -1, &handles, message, NULL, NULL, NULL, NULL);
+       }
 }
 
 static void