Bug 26211

Summary: Generate constants for namespaced contact attributes
Product: Telepathy Reporter: Simon McVittie <smcv>
Component: tp-glibAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: major    
Priority: high CC: cosimo.alfarano
Version: git masterKeywords: patch
Hardware: Other   
OS: All   
URL: http://git.collabora.co.uk/?p=user/smcv/telepathy-glib-smcv.git;a=shortlog;h=refs/heads/tokens
Whiteboard:
i915 platform: i915 features:

Description Simon McVittie 2010-01-25 07:05:25 UTC
Bug #26210 demonstrates that we should generate string constants for well-known contact attributes (and also capability tokens). I propose TP_TOKEN_${interface}_${token}, like TP_TOKEN_CONNECTION_INTERFACE_CONTACT_CAPABILITIES_CAPABILITIES.
Comment 1 Cosimo Alfarano 2010-04-19 05:42:26 UTC
Please review the TP_TOKEN_* constant generation.

It ignores "is-family=yes" for tp:hct.

It also replaces "-" and "." with "_" for both "tp:hct" and "contact-attribute" elements' constants.

C.
Comment 2 Simon McVittie 2010-04-19 06:17:31 UTC
Looks good so far, but all the #defines that result from this ought to be in the documentation (docs/reference/*sections.txt).
Comment 3 Cosimo Alfarano 2010-04-20 07:34:17 UTC
Added manually, this means that every token added in spec will have to be added in docs/reference/*sections.txt even though it's automatically recognized by tool/glib-interfaces-gen.py.

It it's right, the branch is updated.
Comment 4 Simon McVittie 2010-04-20 08:12:23 UTC
Fixed in 0.11.3
Comment 5 Simon McVittie 2010-04-30 04:59:11 UTC
Actually, these constants are wrong in 0.11.3 and 0.11.4; they have a dot in, whereas we want a slash.

I blame the reviewer (some guy called Simon...), who should have spotted this, and should also have insisted on a regression test.

Here's a branch fixing this:
http://git.collabora.co.uk/?p=user/smcv/telepathy-glib-smcv.git;a=shortlog;h=refs/heads/tokens
Comment 6 Simon McVittie 2010-04-30 05:01:51 UTC
This could break people quite badly when doing the recommended thing, so major/high.
Comment 7 Jonny Lamb 2010-04-30 05:34:07 UTC
Not sure if I'm a tp-glib reviewer, but review+.
Comment 8 Simon McVittie 2010-04-30 06:40:58 UTC
(In reply to comment #7)
> Not sure if I'm a tp-glib reviewer, but review+.

I think you qualify :-)

Thanks, fixed in git for 0.11.5.

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.