1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Added question answer messages for libotr 4.0.0

This commit is contained in:
James Booth 2014-05-07 21:15:28 +01:00
parent 1e4fc2ce79
commit c6ba84096d

View File

@ -127,18 +127,29 @@ cb_handle_smp_event(void *opdata, OtrlSMPEvent smp_event,
g_hash_table_insert(smp_initiators, strdup(context->username), strdup(context->username)); g_hash_table_insert(smp_initiators, strdup(context->username), strdup(context->username));
break; break;
case OTRL_SMPEVENT_ASK_FOR_ANSWER:
ui_smp_recipient_initiated_q(context->username, question);
break;
case OTRL_SMPEVENT_SUCCESS: case OTRL_SMPEVENT_SUCCESS:
ui_smp_successful(context->username); if (context->smstate->received_question == 0) {
ui_trust(context->username); ui_smp_successful(context->username);
ui_trust(context->username);
} else {
ui_smp_answer_success(context->username);
}
break; break;
case OTRL_SMPEVENT_FAILURE: case OTRL_SMPEVENT_FAILURE:
if (nextMsg == OTRL_SMP_EXPECT3) { if (context->smstate->received_question == 0) {
ui_smp_unsuccessful_sender(context->username); if (nextMsg == OTRL_SMP_EXPECT3) {
ui_untrust(context->username); ui_smp_unsuccessful_sender(context->username);
} else if (nextMsg == OTRL_SMP_EXPECT4) { } else if (nextMsg == OTRL_SMP_EXPECT4) {
ui_smp_unsuccessful_receiver(context->username); ui_smp_unsuccessful_receiver(context->username);
}
ui_untrust(context->username); ui_untrust(context->username);
} else {
ui_smp_answer_failure(context->username);
} }
break; break;
@ -155,9 +166,6 @@ cb_handle_smp_event(void *opdata, OtrlSMPEvent smp_event,
ui_untrust(context->username); ui_untrust(context->username);
break; break;
case OTRL_SMPEVENT_ASK_FOR_ANSWER:
break;
case OTRL_SMPEVENT_IN_PROGRESS: case OTRL_SMPEVENT_IN_PROGRESS:
break; break;