Bug 57401 - Some user aliases contains HTML-escaped characters
Summary: Some user aliases contains HTML-escaped characters
Status: RESOLVED NOTOURBUG
Alias: None
Product: Telepathy
Classification: Unclassified
Component: gabble (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-22 08:45 UTC by Marcus Lundblad
Modified: 2012-11-23 12:40 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Marcus Lundblad 2012-11-22 08:45:29 UTC
Some users on my roster has HTML-escaped characters in their names.
This seems to be server-dependent:

Here is a log example of a friend on my gmail.com roster (which is working correctly):

        * item jid='xxx@gmail.com' subscription='both' name='Per Starbäck' xmlns:ros='google:roster' ros:w='1' xmlns:ros='google:roster' ros:mc='5' xmlns:ros='google:roster' ros:emc='3'
            * group
                "General"

(I sensored out the JID there).

Another friend on my jabber.org roster, however (with accented characters) comes out like this:

        * item jid='yyy@gmail.com' name='Lars Silvén' subscription='both'
            * group
                "Primekey"

And this escaped name occurs in Empathy's contact list in it's raw form.

So, this seems to be happening specifically for M-Link (also contacts from the Facebook gateway works like they should).
Comment 1 Simon McVittie 2012-11-22 10:39:13 UTC
(In reply to comment #0)
> Another friend on my jabber.org roster, however (with accented characters)
> comes out like this:
> 
>         * item jid='yyy@gmail.com' name='Lars Silvén'
> subscription='both'

By the time the XML is pretty-printed like this, it's already been unescaped in Wocky (arguably, it ought to re-escape it before it prints it, but this is just a debug log anyway). I suspect that what the server is actually sending you might look more like this:

<item jid='yyy@gmail.com' name='Lars Silv&amp;#xE9;n'

(i.e. uselessly double-escaped).

Could you try running Gabble with WOCKY_DEBUG=all (see http://telepathy.freedesktop.org/wiki/Debugging for details) and see what XML your server is actually sending? (This log might contain private information and need censoring - in particular, don't show us the SASL handshake when you log in.)

If it is indeed sending double-escaped names, then I'm afraid this is not Gabble's fault. You should be able to rename the offending contacts, hopefully (e.g. right-click -> Edit, in Empathy).
Comment 2 Marcus Lundblad 2012-11-23 08:49:29 UTC
This is a snippet from the raw XMPP stream:

<item jid='zzz@gmail.com' name='Lars Silv&amp;#xE9;n' subscription='both'>

So, it indeed looks as if the alias comes in double-escaped in this case.
Comment 3 Simon McVittie 2012-11-23 11:41:33 UTC
Probably NOTOURBUG, then; Gabble is doing what it's told, but what it was told by the server is wrong.

This could be because either

1. the server is storing names wrong; or
2. when you previously set your friend's name, your IM client (either
  Gabble + Empathy, or another client like Pidgin if you use one) stored
  it incorrectly; or
3. your friend's name was copied from what they set as their alias, and
  when they set that, it was stored incorrectly

To try to rule out (2): if you use Empathy to rename the contact to Lars Silvén (which I assume is what it was meant to be), does it get stored correctly after that? What if you do that, then sign out and back in?

(Again, the relevant bits of the XMPP stream would be useful information.)
Comment 4 Marcus Lundblad 2012-11-23 12:13:22 UTC
If I update the name in Empathy, it gets updated correctly in the contact list.

Wocky sends the folling stanza to update the contact:

(telepathy-gabble:16455): wocky-DEBUG: Writing xml: <iq type="set" id="345172379990"><query xmlns="jabber:iq:roster"><item jid="xxx" subscription="both" name="Lars Silv&#xE9;n"><group>Primekey</group></item></query></iq>

So, this looks right (escaped correctly, I think).

However, after signing out and in again it's back being escaped.
So, I think the server is doing the wrong thing here, indeed.
Comment 5 Simon McVittie 2012-11-23 12:40:59 UTC
(In reply to comment #4)
> Wocky sends the folling stanza to update the contact:
> 
> (telepathy-gabble:16455): wocky-DEBUG: Writing xml: <iq type="set"
> id="345172379990"><query xmlns="jabber:iq:roster"><item jid="xxx"
> subscription="both" name="Lars
> Silv&#xE9;n"><group>Primekey</group></item></query></iq>

Yeah, that looks good to me.

> So, I think the server is doing the wrong thing here, indeed.

NOTOURBUG then.


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.