Bug 27325

Summary: GetContactAttributes() is specified to be needlessly fascist about interfaces
Product: Telepathy Reporter: Will Thompson <will>
Component: tp-specAssignee: 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   
Whiteboard: review+
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 27374    

Description Will Thompson 2010-03-26 04:02:59 UTC
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 2 Simon McVittie 2010-03-29 05:33:15 UTC
I think Rob was in favour of it being this fascist, but I can't remember why...
Comment 3 Robert McQueen 2010-03-29 05:41:18 UTC
(In reply to comment #2)
> I think Rob was in favour of it being this fascist, but I can't remember why...

If so, I was wrong due to lack of any supporting rationale recorded, that any of us can remember, or that we can think of. I apologise, and give free leave to reduce fascism wherever possible in the interests of reducing roundtrips. The reason /may/ have been not being able to tell the difference between supported-but-not-known-for-this-contact versus not-supported. But for simple use cases, you don't care about this.
Comment 4 Simon McVittie 2010-03-29 05:54:48 UTC
review+, in that case. Considering this to have been specmeet-approved since most of the usual specmeet cabal have been involved.

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 %).
Comment 5 Will Thompson 2010-03-30 11:56:53 UTC
Spec and tp-glib bits merged; butterfly bit cloned as bug 27374.

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.