[Bug 41789] Expose Facebook ids into Facebook Chat contacts’

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Nov 17 13:03:28 CET 2011


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

--- Comment #5 from Simon McVittie <simon.mcvittie at collabora.co.uk> 2011-11-17 04:03:28 PST ---
> @@ -223,6 +223,28 @@ gabble_parse_vcard_address (const gchar *vcard_field,

This seems to be taking a JID and converting it into a Facebook ID. I'm pretty
sure that's wrong: it should be expecting an unsigned ASCII integer (e.g.
12345) and returning -12345 at chat.facebook.com, or raising an error if the vCard
field value isn't an unsigned ASCII integer.

Now that I look at that function again: is it meant to return a JID, or a
normalized value for that vCard field? For x-jabber they're equivalent, but for
x-facebook-id they're not! You'll need to split it into "normalize", "to_jid",
"jid_to", as for URIs.

Here are some high-level things that we want to be true:

    NormalizeVCardAddress("x-facebook-id", "12345") -> "12345"
    NormalizeVCardAddress("x-facebook-id", "not a number") -> error
    NormalizeVCardAddress("x-facebook-id", "-12345") -> error
    NormalizeVCardAddress("x-facebook-id", "-12345 at chat.facebook.com") -> error
    NormalizeVCardAddress("x-jabber", "-12345 at CHAT.FaceBook.com")
        -> "-12345 at chat.facebook.com")

    GetContactsByVCardField("x-facebook-id", ["12345"], [])
        -> details of the contact with JID "-12345 at chat.facebook.com"
    GetContactsByVCardField("x-facebook-id", [x], [])
        -> no result for any x that produced an error above

    "/addresses" attr of "-12345 at chat.facebook.com"
        -> { "x-jabber": "-12345 at chat.facebook.com", "x-facebook-id": "12345" }
    "/addresses" attr of "dave at example.com"
        -> { "x-jabber": "dave at example.com" }

-- 
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