Bug 27374

Summary: GetContactAttributes() is specified to be needlessly fascist about interfaces
Product: Telepathy Reporter: Will Thompson <will>
Component: butterflyAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium Keywords: patch
Version: git master   
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/wjt/telepathy-butterfly.git;a=commit;h=68f3333cbefe3ce029d1d239b4077828c71984b2
Whiteboard:
i915 platform: i915 features:
Bug Depends on: 27325    
Bug Blocks:    

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.