[Bug 30874] GetContactAttributesByID: GetContactAttributes but from identifiers instead of handles

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue May 8 13:15:06 CEST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=30874

--- Comment #4 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2012-05-08 04:15:06 PDT ---
The API in your spec branch, returning an a{ua{sv}}, doesn't work: if the
protocol is case-insensitive and does not allow spaces, and I call

    GetContactAttributesByID(["Alice", "Bob", "Chris D"], [])

where Alice's handle is 1 and Bob's is 2, I will get back

    { 1: { ".../contact-id": "alice" }, 2: { ".../contact-id": "bob" } }

Without knowledge of how the protocol normalizes and validates names, I can't
know that "Alice" and "alice" are the same contact, or even that "Chris D" was
the identifier that wasn't syntactically valid! This is the same flaw that was
present in drafts of Addressing1.

I think we should fix this by changing the signature to resemble the methods in
Addressing, and while we're at it, we can shorten the name:

    GetContactsByID(as: Identifiers, as: Interfaces)
        -> a{su}: Requested, a{ua{sv}}: Attributes

so that

    GetContactAttributesByID(["Alice", "Bob", "Chris D"], [])

would return

    { "Alice": 1, "Bob": 2 },
    { 1: { ".../contact-id": "alice" }, 2: { ".../contact-id": "bob" } }

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list