mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
ui_smp_recipient_initiated_q takes ProfChatWin
This commit is contained in:
parent
55e857d6a8
commit
3ce55de1e1
@ -152,10 +152,13 @@ otrlib_handle_tlvs(OtrlUserState user_state, OtrlMessageAppOps *ops, ConnContext
|
||||
if (nextMsg != OTRL_SMP_EXPECT1) {
|
||||
otrl_message_abort_smp(user_state, ops, NULL, context);
|
||||
} else {
|
||||
ProfChatWin *chatwin = wins_get_chat(context->username);
|
||||
if (chatwin) {
|
||||
char *question = (char *)tlv->data;
|
||||
char *eoq = memchr(question, '\0', tlv->len);
|
||||
if (eoq) {
|
||||
ui_smp_recipient_initiated_q(context->username, question);
|
||||
ui_smp_recipient_initiated_q(chatwin, question);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -189,7 +189,9 @@ cb_handle_smp_event(void *opdata, OtrlSMPEvent smp_event,
|
||||
break;
|
||||
|
||||
case OTRL_SMPEVENT_ASK_FOR_ANSWER:
|
||||
ui_smp_recipient_initiated_q(context->username, question);
|
||||
if (chatwin) {
|
||||
ui_smp_recipient_initiated_q(chatwin, question);
|
||||
}
|
||||
break;
|
||||
|
||||
case OTRL_SMPEVENT_SUCCESS:
|
||||
|
@ -110,15 +110,14 @@ ui_smp_recipient_initiated(ProfChatWin *chatwin)
|
||||
}
|
||||
|
||||
void
|
||||
ui_smp_recipient_initiated_q(const char *const barejid, const char *question)
|
||||
ui_smp_recipient_initiated_q(ProfChatWin *chatwin, const char *question)
|
||||
{
|
||||
ProfChatWin *chatwin = wins_get_chat(barejid);
|
||||
if (chatwin) {
|
||||
win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "", "%s wants to authenticate your identity with the following question:", barejid);
|
||||
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", question);
|
||||
win_print((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "", "use '/otr answer <answer>'.");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ui_smp_unsuccessful_sender(const char *const barejid)
|
||||
|
@ -67,7 +67,7 @@ void ui_gone_insecure(ProfChatWin *chatwin);
|
||||
void ui_trust(const char *const barejid);
|
||||
void ui_untrust(const char *const barejid);
|
||||
void ui_smp_recipient_initiated(ProfChatWin *chatwin);
|
||||
void ui_smp_recipient_initiated_q(const char *const barejid, 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_unsuccessful_sender(const char *const barejid);
|
||||
|
@ -71,7 +71,7 @@ void ui_gone_insecure(ProfChatWin *chatwin) {}
|
||||
void ui_trust(const char * const barejid) {}
|
||||
void ui_untrust(const char * const barejid) {}
|
||||
void ui_smp_recipient_initiated(ProfChatWin *chatwin) {}
|
||||
void ui_smp_recipient_initiated_q(const char * const barejid, 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_unsuccessful_sender(const char * const barejid) {}
|
||||
|
Loading…
Reference in New Issue
Block a user