Issue libpurple and jabber protocol plugin

JT tyra0002 at umn.edu
Tue Jun 9 12:52:08 EDT 2009


I've had a somewhat strange issue pop up while implementing my own
plugin on top of libpurple / pidgin. 

Basically I'm adding a custom encryption / decryption layer to the group
chat portion of jabber. The crypt routines are application agnostic, you
send in bits receive bits. 

So I have been developing a pidgin plugin to allow one to crypt jabber
chat sessions using my crypto library. By chat I mean multi-user
chatroom sessions , NOT "im" sessions. My plugin is very similar to the
otr (off the record) plugin, only for chat.


Anyway, I've noticed some oddities when I've "hooked" into the chat ui.
I've created signal_connects to "sending-chat-msg" and
"receiving-chat-msg". 

The problem is the callback for "sending-chat-msg" gets exactly what the
chat participant types into the window. If he says "Hello.", the message
buffer has "Hello."

But inside the callback for "receiving-chat-msg" I get the XML'ed /
marked up jabber specific message. It contains what I need, but lots
more. Obviously, I cant just erase this buffer as the jabber protocol
plugin has not processed it completely. I have to leave all of the XML
as is, an just decrypt and replace the message. 

I have worked around this by creating a signal connect to jabbers
"jabber-receiving-xmlnode" and using xmlnode functions to get, decrypt
and replace the message and its working. But it feels very "hackish."

I have NOT tested this with other protocols, as I am only interested in
jabber. I am curious if this is intended behavior or some type of bug?
Maybe this is somewhat of a known issue and/or just how things work?

Any input or feedback would be appreciated.

-JT

















More information about the Devel mailing list