]> git.0d.be Git - empathy.git/commitdiff
Do not auto-accept publish requests if contact is not subscribed
authorXavier Claessens <xclaesse@gmail.com>
Wed, 24 Aug 2011 09:25:11 +0000 (11:25 +0200)
committerXavier Claessens <xclaesse@gmail.com>
Wed, 24 Aug 2011 14:34:16 +0000 (16:34 +0200)
Fixes bug #657173

libempathy/empathy-tp-contact-list.c

index d9fb18182d401fcffac56c2844248760b35617c9..1cd2ba4caded1dfb337defedbce6afe008e946a8 100644 (file)
@@ -461,12 +461,18 @@ tp_contact_list_got_local_pending_cb (TpConnection            *connection,
                TpHandle handle;
                const gchar *message;
                TpChannelGroupChangeReason reason;
+               const TpIntSet *members, *remote_pending;
 
                handle = empathy_contact_get_handle (contact);
-               if (g_hash_table_lookup (priv->members, GUINT_TO_POINTER (handle))) {
+               members = tp_channel_group_get_members (priv->subscribe);
+               remote_pending = tp_channel_group_get_remote_pending (priv->subscribe);
+
+               if (tp_intset_is_member (members, handle) ||
+                   tp_intset_is_member (remote_pending, handle)) {
                        GArray handles = {(gchar *) &handle, 1};
 
-                       /* This contact is already member, auto accept. */
+                       /* This contact is already subscribed, or user requested
+                        * to subscribe, auto accept. */
                        tp_cli_channel_interface_group_call_add_members (priv->publish,
                                -1, &handles, NULL, NULL, NULL, NULL, NULL);
                }