[OTR-users] OTR plugin for X-Chat

Ian Goldberg ian at cypherpunks.ca
Wed Sep 19 17:55:25 EDT 2007


On Wed, Sep 19, 2007 at 04:53:47PM -0400, konrad at tylerc.org wrote:
> On Sun, Sep 16, 2007 at 12:32:16 -0400, Ian Goldberg wrote:
> >On Sun, Sep 16, 2007 at 02:08:42AM -0700, Konrad Meyer wrote:
> >> I know gaim has an IRC mode, but I'd like to use OTR in X-Chat. Before
> I go
> >> ahead and write it myself, though, I was wondering if there had been any
> >> efforts made in this direction by anyone else in the past. If not, do
> folks
> >> have any pointers for using libotr? (I am someone relatively unfamiliar
> >> with the internals of libotr.)
> >
> >I don't know of one.  Let me know if you need some pointers in how to
> >integrate libotr, though.
> >
> >   - Ian
> 
> Hey, I have a question now :D. Why would anyone want to use a fragment
> policy other than OTRL_FRAGMENT_SEND_ALL?

pidgin uses a different policy, for example.  Here's what's going on:

When there's a message to be sent, the sending-im-msg callback of each 
plugin is called.  Those plugins have the opportunity to modify the
message that's about to be sent, by changing a pointer value passed into
it.  Normally, pidgin-otr changes the message to an encrypted version of
the message, for example.

But there's no way for a plugin to indicate "change the message about to
be sent into these (for example) 3 messages".  So pidgin-otr uses the
fragment policy of OTRL_FRAGMENT_SEND_ALL_BUT_LAST to tell libotr that
it's going to send all but the last fragment right now, but let the last
fragment stick around, getting pointed to by that newly mofidied
pointer, so that pidgin will send it on its own.

You might say, "Why not just send all the fragments, and set the
message-about-to-be-sent pointer to NULL"?  The problem is that if you
do that, pidgin decides it doesn't need to *show you the message you
just typed*.  Luckily, if it's anything non-NULL, pidgin shows you *what
you originally typed*, and not whatever it was modified to before being
sent over the wire (the encrypted version).

Does that make sense?

Thanks,

   - Ian



More information about the OTR-users mailing list