Bug 27374 - GetContactAttributes() is specified to be needlessly fascist about interfaces
Summary: GetContactAttributes() is specified to be needlessly fascist about interfaces
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: butterfly (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/wj...
Whiteboard:
Keywords: patch
Depends on: 27325
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-30 11:54 UTC by Will Thompson
Modified: 2010-04-02 12:39 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Will Thompson 2010-03-30 11:54:24 UTC
+++ This bug was initially created as a clone of Bug #27325 +++

From the definition of GetContactAttributes():

> It is an error to request interfaces that are not supported by this
> Connection (i.e. mentioned in the ContactAttributeInterfaces
> property).
>
> | This makes it possible to distinguish between interfaces for which
> | the Connection has nothing to say (e.g. we don't know the avatar
> | tokens of any of the contacts, so we omitted them all), and interfaces
> | for which this API isn't supported.

This is needlessly pedantic. If we had instead said that the CM must
ignore interfaces which aren't supported on the Contacts interface, then
client code that does care could still check ContactAttributeInterfaces
to distinguish those two cases, and client code that doesn't care
wouldn't have to mess around checking the list of interfaces it passes
to GetContactAttributes().
Comment 1 Will Thompson 2010-03-30 11:56:39 UTC
Here's a Butterfly patch. People who use Butterfly should probably test that it works. :)

Simon said on bug 27325:
> Non-review-blocker:
> 
> > +                logger.debug("Ignoring unsupported interface " + interface)
> 
> logger.debug("Ignoring unsupported interface %s", interface) is conventional
> (if called with more than one argument, logger methods interpolate their
> arguments into the first one as if via %).

Someone should tell this to the rest of butterfly, which always uses either + or % rather than just passing extra args. I've updated my patch to use %.
Comment 2 Jonny Lamb 2010-04-02 12:39:05 UTC
Will's first butterfly contribution! What would haze think?


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.