<div dir="ltr">Hello,<div><br></div><div>Thank you for your help, I found my mistake. <br><br>After reading your email, I saw that it created a new context, I dig a bit more, and see it was not able to find my contact in the OtrlUserState, simply because I was not using the right account name for the recipient...</div><br><br>Indeed, for the connection I was using the account "<a href="mailto:amonchakai@jabber.de">amonchakai@jabber.de</a>" which got converted to "<a href="http://amonchakai@jabber.de/mbpr-2">amonchakai@jabber.de/mbpr-2</a>" and since for test purpose, I was hardcoding the account name in my function calls, I did not saw it... it was not critical for XMPP, but it obviously is for OTR. <br><br>With the right account name, it now work.<br><br>Sorry for the trouble, and thanks again for the help! <div><span style="font-family:Monaco;font-size:11px"><br></span></div><div><span style="font-family:Monaco;font-size:11px"><br></span></div><div><span style="font-family:Monaco;font-size:11px">Kind regards</span></div><div><span style="font-family:Monaco;font-size:11px">Pierre</span></div><div><span style="font-family:Monaco;font-size:11px"><br></span></div><div><span style="font-family:Monaco;font-size:11px"><br></span></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-06-28 23:41 GMT+02:00 Ian Goldberg <span dir="ltr"><<a href="mailto:ian@cypherpunks.ca" target="_blank">ian@cypherpunks.ca</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sun, Jun 28, 2015 at 10:30:31PM +0200, Pierre Lebreton wrote:<br>
> Hello again,<br>
><br>
><br>
> So I have been doing some digging, and I can see:<br>
><br>
> when gone_secure is called, I have context->msgstate equal to<br>
> OTRL_MSGSTATE_ENCRYPTED<br>
><br>
><br>
> Just before, "otrl_message_sending", msgstate is still equal to<br>
> OTRL_MSGSTATE_ENCRYPTED for the appropriate contact.<br>
><br>
> However, during the call, I have a message event triggered, and I can see<br>
> the message "OTRL_MSGEVENT_ENCRYPTION_REQUIRED".<br>
> And the value of context->msgstate changed to OTRL_MSGSTATE_PLAINTEXT<br>
><br>
> After the end of the call of "otrl_message_sending" the msgstate is equal<br>
> to OTRL_MSGSTATE_PLAINTEXT.<br>
><br>
> Maybe that would help to identify my mistake?<br>
><br>
> Thanks<br>
<br>
</span>Is the context pointer the same when context->msgstate is ENCRYPTED and<br>
when it's PLAINTEXT?  OTRL_MSGEVENT_ENCRYPTION_REQUIRED will only be<br>
called when the msgstate is already PLAINTEXT, so the question is why<br>
either (a) the context is switching to PLAINTEXT, or (b) a new context<br>
is being created.  If you were using OTRv3, I would suspect it has to do<br>
with instance tags and child contexts, but it appears you're just using<br>
OTRv2?<br>
<div class="HOEnZb"><div class="h5"><br>
   - Ian<br>
_______________________________________________<br>
OTR-dev mailing list<br>
<a href="mailto:OTR-dev@lists.cypherpunks.ca">OTR-dev@lists.cypherpunks.ca</a><br>
<a href="http://lists.cypherpunks.ca/mailman/listinfo/otr-dev" rel="noreferrer" target="_blank">http://lists.cypherpunks.ca/mailman/listinfo/otr-dev</a><br>
</div></div></blockquote></div><br></div>