[OTR-dev] Requirements for libotr4

Jonathan Schleifer js-otrim@webkeks.org
Wed, 18 Jun 2008 16:47:37 +0200


--Sig_/WdHd9zEsHH.04mrvpvqMY=e
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Ian Goldberg <ian@cypherpunks.ca> wrote:

> Isn't that what opdata is for?  inject_message returns void, because
> we can't predict what kinds of things you might want to return.
> Instead, it takes as a parameter an arbitrary void* opdata, which you
> can use however you want (pass &retval for example).

I must admit that I'm not too familiar with libotr itself as I only used
the pyotr bindings of it (Gajim is written in Python).
So basically, you say I should give a void *opdata to the
otrl_message_fragment_and_send function and modify it in the
inject_message function and get it from opdata again after calling
otrl_message_fragment_and_send? I haven't tested it now, but that
sounds like it should work, thanks for pointing out.

But what I'd prefer is that inject_message doesn't return void but
void*, so one could return arbitrary data (in this case it's the stanza
ID) and then some way to get that return value from the function called.

> So your inject_message function could set *(XmppId *)opdata =3D id and
> you would have access to that when the call to otrl_message_sending
> completes.

That sounds good enough for me.

> But I thought XMPP didn't need fragmentation, anyway?

XMPP itself doesn't, but it's possible to use ICQ through transports
via XMPP, thus you'll need it then.

> If you use a fragment policy of OTRL_FRAGMENT_SEND_ALL_BUT_FIRST or
> OTRL_FRAGMENT_SEND_ALL_BUT_LAST, and there's no fragmentation to be
> done, otrl_message_fragment_and_send will just return to you the
> (unfragmented) message to be sent, and you can send it yourself.

I guess this will give problems with ICQ through transports.
If otrl_message_fragment_and_send returns the fragments, wouldn't be
another possible way to send those fragments manually? That would have
the advantage that I get the ID of every sent message, not only the
first / last ID. That would be a big advantage, as we could request a
receipt for every fragment seperately then.

--=20
Jonathan

--Sig_/WdHd9zEsHH.04mrvpvqMY=e
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----

iQIcBAEBAwAGBQJIWSANAAoJEMtRg9d5cXHk9xkP/1b84sRNpU3VI38Fh1UW1CSQ
QZgsv1/s4orS9e1ys9V0mylReLv2mbKErfgI8HRHMV13EppxUQmHWIBkhDYOJiCB
N8Vb1X3gu44+bgKIw70DhRLKzaD7A1mgF/NpeU4zbxhdPnJ8RQD+lIZOkCi8t8h2
vV5zo52d/qvaZHgzWpjauM23rvp9FpZ+Sj8vXaVNKjw/bCtWeTsrVfT5fV7Y89No
dYK0D2crvYvR3e7TunvlZYOPnnFpm1qdJZSeVbaJlhxTHGk2z3owGvKMJkWQyrp4
q1TvtS0bSTuXdvjxhAfNFK9vGfw/3D0ws43bLQSg2+kERJi4UQxpf5pEebbLuNKu
bDxWz/hcH0zSulIMsM+xZS223orsYJDoS+DQWR3AeoKFlE6i2Ejw3TEt2BO545FR
kDMowHwLs5fCvUs+N1C6IZ7U+cTdA1qYLJI/JZnK2LXVDmquWFXpZ3//sML6zIIh
BZ8s//AuiABOPn0o/XLBngkl/P92ultA7gsjW9QMeDpsqcRSLxqJkE8igMpCC0YH
x4r6pXrO2/iPcgzmGQAPraHKldNJGxLBLptulSNPsBHCX0OjtIp+Ak3FViwzsLLr
OI9GWZdXfjbWC2Tkl3+BXabxEqSY1qlNyjOrK54a968NWr24+VQepj15WijsWi3m
aAWqgEiGnMQuChta2ntV
=vDsp
-----END PGP SIGNATURE-----

--Sig_/WdHd9zEsHH.04mrvpvqMY=e--