[empathy] Do not auto-accept publish requests if contact is not subscribed



commit 34444b9a90be269af9d7af39ca064741de2123a5
Author: Xavier Claessens <xclaesse gmail com>
Date:   Wed Aug 24 11:25:11 2011 +0200

    Do not auto-accept publish requests if contact is not subscribed
    
    Fixes bug #657173

 libempathy/empathy-tp-contact-list.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c
index d9fb181..1cd2ba4 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);
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]