aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-07-12 21:23:09 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-07-12 21:23:09 +0800
commit0083f8d68ad8e20d8d78a7bc800b62676d70648d (patch)
tree2c81df08a656cd0d12ef2427c8085105543550cf /libempathy
parenta8a6226a74d81da8c8a6c6766c56a15993d2eb47 (diff)
downloadgsoc2013-empathy-0083f8d68ad8e20d8d78a7bc800b62676d70648d.tar
gsoc2013-empathy-0083f8d68ad8e20d8d78a7bc800b62676d70648d.tar.gz
gsoc2013-empathy-0083f8d68ad8e20d8d78a7bc800b62676d70648d.tar.bz2
gsoc2013-empathy-0083f8d68ad8e20d8d78a7bc800b62676d70648d.tar.lz
gsoc2013-empathy-0083f8d68ad8e20d8d78a7bc800b62676d70648d.tar.xz
gsoc2013-empathy-0083f8d68ad8e20d8d78a7bc800b62676d70648d.tar.zst
gsoc2013-empathy-0083f8d68ad8e20d8d78a7bc800b62676d70648d.zip
Auto-accept to publish presence to contacts that are in our subscribe
2007-07-12 Xavier Claessens <xclaesse@gmail.com> * libempathy/empathy-tp-contact-list.c: Auto-accept to publish presence to contacts that are in our subscribe list. When accepting a pending contact add it to publish and subscribe list. svn path=/trunk/; revision=180
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-tp-contact-list.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c
index dd04fac53..213e5c6ba 100644
--- a/libempathy/empathy-tp-contact-list.c
+++ b/libempathy/empathy-tp-contact-list.c
@@ -535,6 +535,7 @@ tp_contact_list_process_pending (EmpathyContactList *list,
handle = empathy_contact_get_handle (contact);
if (accept) {
empathy_tp_group_add_member (priv->publish, handle, NULL);
+ empathy_tp_group_add_member (priv->subscribe, handle, NULL);
} else {
empathy_tp_group_remove_member (priv->publish, handle, NULL);
}
@@ -1244,14 +1245,25 @@ tp_contact_list_pending_cb (EmpathyTpGroup *group,
list_type);
if (list_type == TP_CONTACT_LIST_TYPE_PUBLISH) {
- EmpathyContactListInfo *info;
-
- info = empathy_contact_list_info_new (contact, message);
- priv->local_pending = g_list_prepend (priv->local_pending,
- info);
-
- g_signal_emit_by_name (list, "local-pending",
- contact, message);
+ if (!g_list_find (priv->members, contact)) {
+ EmpathyContactListInfo *info;
+
+ info = empathy_contact_list_info_new (contact, message);
+ priv->local_pending = g_list_prepend (priv->local_pending,
+ info);
+
+ g_signal_emit_by_name (list, "local-pending",
+ contact, message);
+ } else {
+ guint handle;
+
+ /* That contact wants our presence and he is
+ * in our roster. Accept to publish our presence
+ * without asking the user. */
+ handle = empathy_contact_get_handle (contact);
+ empathy_tp_group_add_member (priv->publish,
+ handle, "");
+ }
}
else if (list_type == TP_CONTACT_LIST_TYPE_SUBSCRIBE) {
if (!g_list_find (priv->members, contact)) {