Bug 35331 - Support ContactBlocking in TpBaseContactList
Summary: Support ContactBlocking in TpBaseContactList
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL: http://cgit.collabora.co.uk/git/user/...
Whiteboard: review+
Keywords: patch
Depends on:
Blocks: 35341
  Show dependency treegraph
 
Reported: 2011-03-15 06:19 UTC by Will Thompson
Modified: 2011-05-25 07:04 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

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.