aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2011-08-24 17:25:11 +0800
committerXavier Claessens <xclaesse@gmail.com>2011-08-24 22:34:16 +0800
commit34444b9a90be269af9d7af39ca064741de2123a5 (patch)
tree3ca89760a5e451454a45047138afd6f8039db0a0 /libempathy
parent96d638486a06118b91086f00d3a6b9d89eb8d445 (diff)
downloadgsoc2013-empathy-34444b9a90be269af9d7af39ca064741de2123a5.tar
gsoc2013-empathy-34444b9a90be269af9d7af39ca064741de2123a5.tar.gz
gsoc2013-empathy-34444b9a90be269af9d7af39ca064741de2123a5.tar.bz2
gsoc2013-empathy-34444b9a90be269af9d7af39ca064741de2123a5.tar.lz
gsoc2013-empathy-34444b9a90be269af9d7af39ca064741de2123a5.tar.xz
gsoc2013-empathy-34444b9a90be269af9d7af39ca064741de2123a5.tar.zst
gsoc2013-empathy-34444b9a90be269af9d7af39ca064741de2123a5.zip
Do not auto-accept publish requests if contact is not subscribed
Fixes bug #657173
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-tp-contact-list.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c
index d9fb18182..1cd2ba4ca 100644
--- a/libempathy/empathy-tp-contact-list.c
+++ b/libempathy/empathy-tp-contact-list.c
@@ -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);
}