[telepathy-gabble/master] Don't skip roster items with gr:autosub="true"

Will Thompson will.thompson at collabora.co.uk
Tue Jul 14 09:46:43 PDT 2009


The intention was to skip roster items which are email addresses, not
JIDs. However, none of the email address-only contacts on my roster have
this set, and there have been bug reports (such as
<https://bugs.launchpad.net/ubuntu/+source/telepathy-gabble/+bug/398293>)
where valid contacts are discarded by this rule.
---
 src/roster.c                               |    6 ------
 tests/twisted/roster/test-google-roster.py |   18 +++++++++++++-----
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/src/roster.c b/src/roster.c
index 79a725b..48d39c0 100644
--- a/src/roster.c
+++ b/src/roster.c
@@ -420,12 +420,6 @@ _google_roster_item_should_keep (LmMessageNode *item_node,
 {
   const gchar *attr;
 
-  /* skip automatically subscribed Google roster items */
-  attr = lm_message_node_get_attribute (item_node, "gr:autosub");
-
-  if (!tp_strdiff (attr, "true"))
-    return FALSE;
-
   /* skip email addresses that replied to an invite */
   attr = lm_message_node_get_attribute (item_node, "gr:alias-for");
 
diff --git a/tests/twisted/roster/test-google-roster.py b/tests/twisted/roster/test-google-roster.py
index 017af9a..a22a367 100644
--- a/tests/twisted/roster/test-google-roster.py
+++ b/tests/twisted/roster/test-google-roster.py
@@ -59,16 +59,24 @@ def test(q, bus, conn, stream):
     # Gabble suppresses contacts labelled as "hidden" from all roster channels.
     add_roster_item(query, 'should-be-hidden at example.com', 'both', False,
         {'gr:t': 'H'})
+    add_roster_item(query, 'lp-bug-298293 at gmail.com', 'both', False,
+        {'gr:autosub': 'true'})
 
     # Send back the roster
     stream.send(result)
 
     # This depends on the order in which roster.c creates the channels.
-    # Since s-b-h had the "hidden" flag set, we expect none of subscribe,
-    # publish or stored to have any members.
-    publish = expect_list_channel(q, bus, conn, 'publish', [])
-    subscribe = expect_list_channel(q, bus, conn, 'subscribe', [])
-    stored = expect_list_channel(q, bus, conn, 'stored', [])
+    # Since s-b-h had the "hidden" flag set, we don't expect them to be on any
+    # lists. But we do want the "autosub" contact to be visible; see
+    # <https://bugs.launchpad.net/ubuntu/+source/telepathy-gabble/+bug/398293>,
+    # where Gabble was incorrectly hiding valid contacts.
+
+    expected_contacts = ['lp-bug-298293 at gmail.com']
+
+    publish = expect_list_channel(q, bus, conn, 'publish', expected_contacts)
+    subscribe = expect_list_channel(q, bus, conn, 'subscribe',
+        expected_contacts)
+    stored = expect_list_channel(q, bus, conn, 'stored', expected_contacts)
 
     contact = 'bob at foo.com'
     handle = conn.RequestHandles(cs.HT_CONTACT, ['bob at foo.com'])[0]
-- 
1.5.6.5




More information about the telepathy-commits mailing list