mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-22 23:56:21 +00:00
ui_smp_unsuccessful_sender takes ProfChatWin
This commit is contained in:
@@ -181,7 +181,10 @@ otrlib_handle_tlvs(OtrlUserState user_state, OtrlMessageAppOps *ops, ConnContext
|
|||||||
ui_smp_successful(context->username);
|
ui_smp_successful(context->username);
|
||||||
ui_trust(context->username);
|
ui_trust(context->username);
|
||||||
} else {
|
} else {
|
||||||
ui_smp_unsuccessful_sender(context->username);
|
ProfChatWin *chatwin = wins_get_chat(context->username);
|
||||||
|
if (chatwin) {
|
||||||
|
ui_smp_unsuccessful_sender(chatwin);
|
||||||
|
}
|
||||||
ui_untrust(context->username);
|
ui_untrust(context->username);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -206,7 +206,9 @@ cb_handle_smp_event(void *opdata, OtrlSMPEvent smp_event,
|
|||||||
case OTRL_SMPEVENT_FAILURE:
|
case OTRL_SMPEVENT_FAILURE:
|
||||||
if (context->smstate->received_question == 0) {
|
if (context->smstate->received_question == 0) {
|
||||||
if (nextMsg == OTRL_SMP_EXPECT3) {
|
if (nextMsg == OTRL_SMP_EXPECT3) {
|
||||||
ui_smp_unsuccessful_sender(context->username);
|
if (chatwin) {
|
||||||
|
ui_smp_unsuccessful_sender(chatwin);
|
||||||
|
}
|
||||||
} else if (nextMsg == OTRL_SMP_EXPECT4) {
|
} else if (nextMsg == OTRL_SMP_EXPECT4) {
|
||||||
ui_smp_unsuccessful_receiver(context->username);
|
ui_smp_unsuccessful_receiver(context->username);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,8 @@ ui_smp_recipient_initiated(ProfChatWin *chatwin)
|
|||||||
{
|
{
|
||||||
assert(chatwin != NULL);
|
assert(chatwin != NULL);
|
||||||
|
|
||||||
win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "", "%s wants to authenticate your identity, use '/otr secret <secret>'.", chatwin->barejid);
|
win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "",
|
||||||
|
"%s wants to authenticate your identity, use '/otr secret <secret>'.", chatwin->barejid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -114,18 +115,19 @@ ui_smp_recipient_initiated_q(ProfChatWin *chatwin, const char *question)
|
|||||||
{
|
{
|
||||||
assert(chatwin != NULL);
|
assert(chatwin != NULL);
|
||||||
|
|
||||||
win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "", "%s wants to authenticate your identity with the following question:", chatwin->barejid);
|
win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "",
|
||||||
|
"%s wants to authenticate your identity with the following question:", chatwin->barejid);
|
||||||
win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "", " %s", question);
|
win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "", " %s", question);
|
||||||
win_print((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "", "use '/otr answer <answer>'.");
|
win_print((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "", "use '/otr answer <answer>'.");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ui_smp_unsuccessful_sender(const char *const barejid)
|
ui_smp_unsuccessful_sender(ProfChatWin *chatwin)
|
||||||
{
|
{
|
||||||
ProfChatWin *chatwin = wins_get_chat(barejid);
|
assert(chatwin != NULL);
|
||||||
if (chatwin) {
|
|
||||||
win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "", "Authentication failed, the secret you entered does not match the secret entered by %s.", barejid);
|
win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "",
|
||||||
}
|
"Authentication failed, the secret you entered does not match the secret entered by %s.", chatwin->barejid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ void ui_smp_recipient_initiated(ProfChatWin *chatwin);
|
|||||||
void ui_smp_recipient_initiated_q(ProfChatWin *chatwin, const char *question);
|
void ui_smp_recipient_initiated_q(ProfChatWin *chatwin, const char *question);
|
||||||
|
|
||||||
void ui_smp_successful(const char *const barejid);
|
void ui_smp_successful(const char *const barejid);
|
||||||
void ui_smp_unsuccessful_sender(const char *const barejid);
|
void ui_smp_unsuccessful_sender(ProfChatWin *chatwin);
|
||||||
void ui_smp_unsuccessful_receiver(const char *const barejid);
|
void ui_smp_unsuccessful_receiver(const char *const barejid);
|
||||||
void ui_smp_aborted(const char *const barejid);
|
void ui_smp_aborted(const char *const barejid);
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ void ui_smp_recipient_initiated(ProfChatWin *chatwin) {}
|
|||||||
void ui_smp_recipient_initiated_q(ProfChatWin *chatwin, const char *question) {}
|
void ui_smp_recipient_initiated_q(ProfChatWin *chatwin, const char *question) {}
|
||||||
|
|
||||||
void ui_smp_successful(const char * const barejid) {}
|
void ui_smp_successful(const char * const barejid) {}
|
||||||
void ui_smp_unsuccessful_sender(const char * const barejid) {}
|
void ui_smp_unsuccessful_sender(ProfChatWin *chatwin) {}
|
||||||
void ui_smp_unsuccessful_receiver(const char * const barejid) {}
|
void ui_smp_unsuccessful_receiver(const char * const barejid) {}
|
||||||
void ui_smp_aborted(const char * const barejid) {}
|
void ui_smp_aborted(const char * const barejid) {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user