First non-encrypted message contains leading space
Brought to you by:
obobo
It seems that the first message you type to someone
after starting GAIM contains a leading space.
This appears to be in the plain text version of the
message, when the person you are sending to does not
have gaim-encryption.
I found this when chatting to a bot on Jabber: The bot
was not understanding the first thing I typed to it,
but it was fine after that. The logs for the bot show
that the first line I typed included a leading space.
I have "Broadcast encryption capability" enabled.
Logged In: YES
user_id=464040
The actual message sent by GAIM (to Jabber) if I type "test"
looks like this:
<body> test</body><html
xmlns='http://jabber.org/protocol/xhtml-im'><body
xmlns='http://www.w3.org/1999/xhtml'><a
HREF='Gaim-Encryption Capable'> </a>test</body></html>
If I type "test" again to the same user, the second message
looks like this:
<body>test</body><html
xmlns='http://jabber.org/protocol/xhtml-im'><body
xmlns='http://www.w3.org/1999/xhtml'>test</body></html>
Logged In: YES
user_id=21203
Yes, and unfortunately this is an intentional workaround for
the re-parsing that the Gaim Jabber plugin does (or at least
did). If the URL element does not include any data (i.e. it
looks like <a HREF="foo"></a>), it is reprocessed to consist
of a standalone XML element (i.e. <a HREF="foo"/>).
I don't know whether the Jabber protocol plugin still does
this "translation", but after futzing with this for a few
Gaim versions, I settled on just adding the space,
converting everything to all caps before comparing to see if
the "capable" string came in, and hoping that it wouldn't
otherwise screw things up.
Sorry that this has bitten you. As you can probably guess,
a straightforward workaround would be to always send a blank
line to the bot before sending the actual command. If the
Gaim Jabber plugin is no longer doing this mangling, I can
take the space out, although I worry slightly that it might
revert in the future. Mind checking to see what the effect
of removing the space is? Look in encrypt.c for the lines:
g_hash_table_insert(notify_table, g_strdup("prpl-jabber"),
g_strdup("<A HREF='Gaim-Encryption
Capable'> </A>"));
and remove the space.
Thanks,
-Bill