Bug 35331

Summary: Support ContactBlocking in TpBaseContactList
Product: Telepathy Reporter: Will Thompson <will>
Component: tp-glibAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium CC: danielle, gkiagia
Version: unspecifiedKeywords: patch
Hardware: Other   
OS: All   
URL: http://cgit.collabora.co.uk/git/user/wjt/telepathy-glib.git/log/?h=blocking
Whiteboard: review+
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 35341    

Description Will Thompson 2011-03-15 06:19:28 UTC
http://telepathy.freedesktop.org/spec-snapshot/Connection_Interface_Contact_Blocking.html is going to be stable in 0.21.13. We should support it in TpBaseContactList. This should not be much work. I have started working on it.

We will need to add a new vfunc, though, to support the Report_Abusive argument to BlockContacts(). CMs should be able to implement either the old one (which doesn't have this argument) or the new one (which should have a gboolean report_abusive) but not both.
Comment 1 Will Thompson 2011-04-16 06:47:09 UTC
I have finished this branch!
Comment 2 Danielle Madeley 2011-05-02 23:38:18 UTC
Pretty good. Minor points follow...

+            /* Sometimes I think we should either make our method names less
+             * verbose, or relax our 80-column limit.
+             */

Probably not useful to include?

-      g_return_if_fail (iface->block_contacts_async != NULL);
+      g_return_if_fail (iface->block_contacts_async != NULL ||
+          iface->block_contacts_with_abuse_async != NULL);

XOR perhaps?

+  if (iface->block_contacts_with_abuse_async != NULL)
+    g_value_set_uint (value, TP_CONTACT_BLOCKING_CAPABILITY_CAN_REPORT_ABUSIVE);
+  else
+    g_value_set_uint (value, 0);
+}

Not expandable. Think this would be better:

if (...)
  flags |= CAN_REPORT_ABUSIVE;

g_value_set_uint (value, flags);
Comment 3 Will Thompson 2011-05-16 03:32:44 UTC
I have pushed three patches to my branch which address your concerns! Complete with a free bitwise XOR.
Comment 4 Danielle Madeley 2011-05-17 19:58:17 UTC
I like it.
Comment 5 Will Thompson 2011-05-25 07:04:54 UTC
Merged! Will be in 0.15.1.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.