<div dir="ltr">Hi Martin,<br><div><div class="gmail_extra"><br><div class="gmail_quote">On 12 March 2014 10:43, Martin Milata <span dir="ltr"><<a href="mailto:b42-ml@srck.net" target="_blank">b42-ml@srck.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Tue, Mar 11, 2014 at 23:33:37 +0000, Alex Burzyński wrote:<br>
> Hi Martin,<br>
><br>
> Thanks for answering, but that triggers more questions!<br>
><br>
> I'm trying to draw some use-cases for those different policies and decide<br>
> if they even should be exposed to the end-user.<br>
<br>
</div>I can't think of a situation where you'd want to expose them to a chat<br>
application user. I'd even say that you should use<br>
OTRL_FRAGMENT_SEND_ALL unless you have a reason not to.<br></blockquote><div><br></div><div>That's exactly what I was thinking, but was wondering why on earth pidgin-otr is using ALL_BUT_LAST<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class=""><br>
> So as I understand the fragmentation, the plain text is encrypted and then<br>
> split into fragments.<br>
><br>
> And in my mind the app's inject_message callback merely sends the message<br>
> fragments to the other end, there shouldn't be any extra logic in there.<br>
> convert_msg looks like a place for that extra logic.<br>
><br>
> So in case of ALL_BUT_LAST what else could the app do with the last<br>
> fragment other then send it? I'd imagine that without the last fragment the<br>
> message wouldn't be readable at all on Bob's end.<br>
><br>
> Could you explain what that hook you've mentioned might want to do with<br>
> that last fragment?<br>
<br>
</div>What I meant is that ALL_BUT_LAST is useful when writing plugin for<br>
existing application. Common pattern is that the plugin registers a<br>
callback/hook that the application calls whenever a message is sent:<br>
<br>
string on_message_send(string message_to_be_sent) {<br>
    ...<br>
    otrl_message_sending(..., &lastfragment, OTRL_FRAGMENT_SEND_ALL, ...);<br>
    ...<br>
    return lastfragment; // application expects the callback to return<br>
                         // modified message<br>
}<br>
<br>
Here's a real-world example where this might be useful:<br>
<a href="http://lists.cypherpunks.ca/pipermail/otr-users/2007-September/001124.html" target="_blank">http://lists.cypherpunks.ca/pipermail/otr-users/2007-September/001124.html</a><br></blockquote><div><br></div><div>Brilliant! That's exactly what I was after.<br>
<br></div><div>I was playing with setting max_message_size to rather low value and trying to work out what the user might want to do with those fragments.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
Hope that makes some sense:)<br>
<span class="HOEnZb"><font color="#888888">Martin<br>
</font></span><div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>Thanks a lot!<br>Alex<br></div></div><br></div></div></div>