[Bug 30296] Add Conn.I.Addressing support to Gabble

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Nov 16 15:21:34 CET 2011


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

--- Comment #17 from Andre Moreira Magalhaes <andrunko at gmail.com> 2011-11-16 14:21:34 UTC ---
(In reply to comment #16)
> I now realise that gabble_parse_uri() doesn't perform RFC 3986 (URI generic
> syntax) processing. If a JID is "wtf?@example.com", then its correct URI form
> is "xmpp:wtf%63 at example.com" - you probably want to use g_uri_escape_string()
> and g_uri_unescape_string() for this.
The implementation now does NormalizeURI("wtf?@example.com") ->
"xmpp:wtf%3F at example.com" and the contact attribute ".../uris" also contains
the escaped versions.
I am escaping the jid components separately (escape(domain), escape(...)), as
escaping the whole jid leads to "@" being escaped, but I am not sure if the
domain and resource should be escaped also.
Please let me know if this is what you meant.

> 
> I feel as though gabble_parse_uri() is the wrong function name: it's really
> gabble_normalize_uri(). It'd maybe make more sense to split it into
> gabble_uri_to_jid() and gabble_jid_to_uri()?
> 
> gabble_uri_for_handle() doesn't do URI escaping either, and should probably
> delegate to gabble_jid_to_uri() for that.
Done. Split in 3 methods, normalize_uri, uri_to_jid and jid_to_uri and updated
gabble_uri_for_handle accordingly.

normalize_uri will always return the uri escaped as described above, as well as
jid_to_uri. 
uri_to_jid always return a normalized jid, with the uri unescaped.

> I'm not sure whether the "jid" side of the JID <-> URI functions should be a
> JID, or a (node or NULL, hostname, resource or NULL) tuple. Probably the
> latter, using wocky_decode_jid() (or gabble_decode_jid(), but that's just a
> thin wrapper around the Wocky equivalent) - you can use gabble_encode_jid() to
> go the other way.
If you are talking about the method param, I kept "jid" there as it makes the
code simpler. I am using gabble_decode/encode_jid internally though.

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



More information about the telepathy-bugs mailing list