HTML in MySpace prpl

Jeff Connelly shellreef at gmail.com
Mon Sep 17 01:07:21 EDT 2007


On 9/16/07, Evan Schoenberg <evan.s at dreskin.net> wrote:
> I'm adding support for your MySpace prpl in Adium,
Awesome! I'm definitely going to have to try this out.

> Here's a message which demonstrates what I'm seeing:
> http://evands.penguinmilitia.net/myspace_prob_1.png
Unfortunately, nested bold/underline/italic formatting is not yet
supported by msimprpl. I filed http://developer.pidgin.im/ticket/3143
to track this issue. The problem is basically that HTML uses
hierarchical tags, while MySpaceIM's markup uses bitfields, so code
will have to be written to translate between the two.

> http://evands.penguinmilitia.net/myspace_prob_2.png
>
> Debug log showing it take <HTML>Simple</HTML> and make it into
> [HTML]Simple[/HTML]
I enclose unknown HTML tags in brackets when converting to MySpaceIM
markup (in html_tag_to_msim_markup() in msimprpl's markup.c), so that
what isn't recognized is immediately apparent. I think this is good
because it encourages bug reports and feedback on unrecognized HTML
sent by the client (and it seems to have worked :).

Fix by changing html_tag_to_msim_markup() to recognize the <html> tag,
and set *begin and *end to g_strdup("") -- therefore replacing the
tags with nothing. I committed this, and a compile-time option to turn
off translating unknown HTML tags to [], in revision
34d642b12b7215d55fd032cd513a7e225715f19a. Patch also available at
http://msimprpl.darkthoughts.net/msimprpl-html-unknown.patch.

Generally, any time you see [tag] .. [/tag] that's an indication of
unsupported HTML in msimprpl sent by the IM client, and msimprpl will
have to be enhanced to support that tag. Ideally, every tag sent by
the IM client will be recognized by msimprpl, so [] will never be
shown.

> Debug log showing it handling <HTML><B>Bold</B></HTML>
> 16:19:48: (Libpurple: msim) msim_convert_xmlnode: got root=root
> 16:19:48: (Libpurple: msim) msim_convert_xmlnode: got root=HTML
> 16:19:48: (Libpurple: msim) msim_convert_xmlnode: got root=B
> 16:19:48: (Libpurple: msim)  ** node data=Bold
> 16:19:48: (Libpurple: msim) msim_markup_xmlnode_to_gtkhtml: RETURNING <f
> s='1'>Bold</f>
> 16:19:48: (Libpurple: msim)  ** node name=B
> 16:19:48: (Libpurple: msim) msim_markup_xmlnode_to_gtkhtml: RETURNING
> [HTML]<f s='1'>Bold</f>[/HTML]
> 16:19:48: (Libpurple: msim)  ** node name=HTML
> 16:19:48: (Libpurple: msim) msim_markup_xmlnode_to_gtkhtml: RETURNING
> [HTML]<f s='1'>Bold</f>[/HTML]
> 16:19:48: (Libpurple: msim) msim_markup_to_html: returning [HTML]<f
> s='1'>Bold</f>[/HTML]
> 16:19:48: (Libpurple: msim) sending 1 message from evan.s at dreskin.net to
> tekjew: [HTML]<f s='1'>Bold</f>[/HTML]
This looks like the MySpaceIM markup is not correctly being translated
to HTML for some reason. Could you send me off-list your Adium with
msimprpl included; I could try to do some debugging and figure out
what is going on.

Hope this helps,
-Jeff




More information about the Devel mailing list