Combined chatwin OTR SMP functions

This commit is contained in:
James Booth
2015-10-27 22:25:02 +00:00
parent 40dcd59727
commit ff9abecd50
8 changed files with 93 additions and 126 deletions

View File

@@ -577,13 +577,13 @@ otr_smp_secret(const char *const recipient, const char *secret)
if (g_hash_table_contains(smp_initiators, recipient)) {
otrl_message_respond_smp(user_state, &ops, NULL, context, (const unsigned char*)secret, strlen(secret));
if (chatwin) {
chatwin_otr_smp_authenticating(chatwin);
chatwin_otr_smp_event(chatwin, PROF_OTR_SMP_AUTH, NULL);
}
g_hash_table_remove(smp_initiators, context->username);
} else {
otrl_message_initiate_smp(user_state, &ops, NULL, context, (const unsigned char*)secret, strlen(secret));
if (chatwin) {
chatwin_otr_smp_authenticaton_wait(chatwin);
chatwin_otr_smp_event(chatwin, PROF_OTR_SMP_AUTH_WAIT, NULL);
}
}
}
@@ -604,7 +604,7 @@ otr_smp_question(const char *const recipient, const char *question, const char *
otrl_message_initiate_smp_q(user_state, &ops, NULL, context, question, (const unsigned char*)answer, strlen(answer));
ProfChatWin *chatwin = wins_get_chat(recipient);
if (chatwin) {
chatwin_otr_smp_authenticaton_wait(chatwin);
chatwin_otr_smp_event(chatwin, PROF_OTR_SMP_AUTH_WAIT, NULL);
}
}