Renamed chatwin OTR functions
This commit is contained in:
@@ -149,7 +149,7 @@ cb_gone_secure(void *opdata, ConnContext *context)
|
||||
chatwin = (ProfChatWin*) wins_new_chat(context->username);
|
||||
}
|
||||
|
||||
ui_gone_secure(chatwin, otr_is_trusted(context->username));
|
||||
chatwin_otr_secured(chatwin, otr_is_trusted(context->username));
|
||||
}
|
||||
|
||||
char*
|
||||
@@ -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) {
|
||||
ui_otr_authenticating(chatwin);
|
||||
chatwin_otr_smp_authenticating(chatwin);
|
||||
}
|
||||
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) {
|
||||
ui_otr_authetication_waiting(chatwin);
|
||||
chatwin_otr_smp_authenticaton_wait(chatwin);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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) {
|
||||
ui_otr_authetication_waiting(chatwin);
|
||||
chatwin_otr_smp_authenticaton_wait(chatwin);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -749,7 +749,7 @@ otr_decrypt_message(const char *const from, const char *const message, gboolean
|
||||
otrl_context_force_plaintext(context);
|
||||
ProfChatWin *chatwin = wins_get_chat(from);
|
||||
if (chatwin) {
|
||||
ui_gone_insecure(chatwin);
|
||||
chatwin_otr_unsecured(chatwin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ otrlib_handle_tlvs(OtrlUserState user_state, OtrlMessageAppOps *ops, ConnContext
|
||||
} else {
|
||||
ProfChatWin *chatwin = wins_get_chat(context->username);
|
||||
if (chatwin) {
|
||||
ui_smp_recipient_initiated(chatwin);
|
||||
chatwin_otr_smp_init(chatwin);
|
||||
}
|
||||
g_hash_table_insert(smp_initiators, strdup(context->username), strdup(context->username));
|
||||
}
|
||||
@@ -158,7 +158,7 @@ otrlib_handle_tlvs(OtrlUserState user_state, OtrlMessageAppOps *ops, ConnContext
|
||||
char *question = (char *)tlv->data;
|
||||
char *eoq = memchr(question, '\0', tlv->len);
|
||||
if (eoq) {
|
||||
ui_smp_recipient_initiated_q(chatwin, question);
|
||||
chatwin_otr_smp_init_q(chatwin, question);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,17 +181,17 @@ otrlib_handle_tlvs(OtrlUserState user_state, OtrlMessageAppOps *ops, ConnContext
|
||||
if (chatwin) {
|
||||
if (context->smstate->received_question == 0) {
|
||||
if (context->active_fingerprint->trust && (context->active_fingerprint->trust[0] != '\0')) {
|
||||
ui_smp_successful(chatwin);
|
||||
ui_trust(chatwin);
|
||||
chatwin_otr_smp_success(chatwin);
|
||||
chatwin_otr_trust(chatwin);
|
||||
} else {
|
||||
ui_smp_unsuccessful_sender(chatwin);
|
||||
ui_untrust(chatwin);
|
||||
chatwin_otr_smp_sender_failed(chatwin);
|
||||
chatwin_otr_untrust(chatwin);
|
||||
}
|
||||
} else {
|
||||
if (context->smstate->sm_prog_state == OTRL_SMP_PROG_SUCCEEDED) {
|
||||
ui_smp_answer_success(chatwin);
|
||||
chatwin_otr_smp_answer_success(chatwin);
|
||||
} else {
|
||||
ui_smp_answer_failure(chatwin);
|
||||
chatwin_otr_smp_answer_failure(chatwin);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -206,11 +206,11 @@ otrlib_handle_tlvs(OtrlUserState user_state, OtrlMessageAppOps *ops, ConnContext
|
||||
ProfChatWin *chatwin = wins_get_chat(context->username);
|
||||
if (chatwin) {
|
||||
if (context->active_fingerprint->trust && (context->active_fingerprint->trust[0] != '\0')) {
|
||||
ui_smp_successful(chatwin);
|
||||
ui_trust(chatwin);
|
||||
chatwin_otr_smp_success(chatwin);
|
||||
chatwin_otr_trust(chatwin);
|
||||
} else {
|
||||
ui_smp_unsuccessful_receiver(chatwin);
|
||||
ui_untrust(chatwin);
|
||||
chatwin_otr_smp_receiver_failed(chatwin);
|
||||
chatwin_otr_untrust(chatwin);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -220,8 +220,8 @@ otrlib_handle_tlvs(OtrlUserState user_state, OtrlMessageAppOps *ops, ConnContext
|
||||
context->smstate->nextExpected = OTRL_SMP_EXPECT1;
|
||||
ProfChatWin *chatwin = wins_get_chat(context->username);
|
||||
if (chatwin) {
|
||||
ui_smp_aborted(chatwin);
|
||||
ui_untrust(chatwin);
|
||||
chatwin_otr_smp_aborted(chatwin);
|
||||
chatwin_otr_untrust(chatwin);
|
||||
}
|
||||
otr_untrust(context->username);
|
||||
}
|
||||
|
||||
@@ -183,24 +183,24 @@ cb_handle_smp_event(void *opdata, OtrlSMPEvent smp_event,
|
||||
{
|
||||
case OTRL_SMPEVENT_ASK_FOR_SECRET:
|
||||
if (chatwin) {
|
||||
ui_smp_recipient_initiated(chatwin);
|
||||
chatwin_otr_smp_init(chatwin);
|
||||
}
|
||||
g_hash_table_insert(smp_initiators, strdup(context->username), strdup(context->username));
|
||||
break;
|
||||
|
||||
case OTRL_SMPEVENT_ASK_FOR_ANSWER:
|
||||
if (chatwin) {
|
||||
ui_smp_recipient_initiated_q(chatwin, question);
|
||||
chatwin_otr_smp_init_q(chatwin, question);
|
||||
}
|
||||
break;
|
||||
|
||||
case OTRL_SMPEVENT_SUCCESS:
|
||||
if (chatwin) {
|
||||
if (context->smstate->received_question == 0) {
|
||||
ui_smp_successful(chatwin);
|
||||
ui_trust(chatwin);
|
||||
chatwin_otr_smp_success(chatwin);
|
||||
chatwin_otr_trust(chatwin);
|
||||
} else {
|
||||
ui_smp_answer_success(chatwin);
|
||||
chatwin_otr_smp_answer_success(chatwin);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -209,13 +209,13 @@ cb_handle_smp_event(void *opdata, OtrlSMPEvent smp_event,
|
||||
if (chatwin) {
|
||||
if (context->smstate->received_question == 0) {
|
||||
if (nextMsg == OTRL_SMP_EXPECT3) {
|
||||
ui_smp_unsuccessful_sender(chatwin);
|
||||
chatwin_otr_smp_sender_failed(chatwin);
|
||||
} else if (nextMsg == OTRL_SMP_EXPECT4) {
|
||||
ui_smp_unsuccessful_receiver(chatwin);
|
||||
chatwin_otr_smp_receiver_failed(chatwin);
|
||||
}
|
||||
ui_untrust(chatwin);
|
||||
chatwin_otr_untrust(chatwin);
|
||||
} else {
|
||||
ui_smp_answer_failure(chatwin);
|
||||
chatwin_otr_smp_answer_failure(chatwin);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -230,8 +230,8 @@ cb_handle_smp_event(void *opdata, OtrlSMPEvent smp_event,
|
||||
|
||||
case OTRL_SMPEVENT_ABORT:
|
||||
if (chatwin) {
|
||||
ui_smp_aborted(chatwin);
|
||||
ui_untrust(chatwin);
|
||||
chatwin_otr_smp_aborted(chatwin);
|
||||
chatwin_otr_untrust(chatwin);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user