[OTR-dev] semantics of MSGSTATE_FINISHED

chris-tuchs at hushmail.com chris-tuchs at hushmail.com
Sun Aug 16 02:44:00 EDT 2009


The finished state also causes a lot of complaints in the Second
Life user base.  However I just point out this scenario, and
they grudgingly get quiet.

Alice and Bob are in private conversation
Alice is typing quickly because she knows Bob is about to leave
Alice types her CC# and Social security number
Bob ends private conversation
Alice hits enter

I don't think Alice would be happy if her message got sent
un-encrypted.  I don't think Alice would be happy if her message
was lost.  The current behavior of GreenLife is to leave the
message in the text entry box, but not to send it.  Instead
Alice sees this message:

[23:22] BobOTR Emerald has ended the private conversation, so
your message was not sent.  You should restart the private
conversation, or end the private conversation.

I had to write code specially to catch and handle that case.
Note I don't even call into libotr if I detect that the
conversation is in the finished state:

    bool was_finished = false;
    if (gOTR && context && (context->msgstate == 
OTRL_MSGSTATE_FINISHED))
    {
	was_finished = true;
    }
    else if (gOTR && (IM_NOTHING_SPECIAL == mDialog))
    {
	// only try OTR for 1 on 1 IM's
	err = otrl_message_sending(
	    gOTR->get_userstate(), 
	    gOTR->get_uistate(), 
	    &mSessionUUID,
	    my_uuid,
	    gOTR->get_protocolid(),
	    their_uuid,
	    &(utf8_text[0]), NULL, &newmessage,
	    NULL, NULL);
    }
    context = getOtrContext();
    if (err)
    {
	otrLogMessageGetstring("otr_err_failed_sending");
	return; // leave the unsent message in the edit box
    }
    if (was_finished)
    {
	otrLogMessageGetstringName("otr_err_send_in_finished");
	return; // leave the unsent message in the edit box
    }

The best suggestion for an alternate behavior I have seen is
that Alice's OTR client should automatically try to restart the
private conversation, and then send the message.  I have decided
not to implement this behavior because Bob may have a good
reason to end the conversation.  Perhaps people, with whom he
doesn't wish to share his private conversation, had just arrived
at his location.

Chris




More information about the OTR-dev mailing list