remaining otr functions take ProfChatWin

This commit is contained in:
James Booth
2015-10-27 00:19:22 +00:00
parent 8bd74cefcf
commit 124aaa9809
7 changed files with 106 additions and 110 deletions

View File

@@ -156,38 +156,64 @@ ui_smp_successful(ProfChatWin *chatwin)
}
void
ui_smp_answer_success(const char *const barejid)
ui_smp_answer_success(ProfChatWin *chatwin)
{
ProfChatWin *chatwin = wins_get_chat(barejid);
if (chatwin) {
win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "", "%s successfully authenticated you.", barejid);
assert(chatwin != NULL);
win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "", "%s successfully authenticated you.", chatwin->barejid);
}
void
ui_smp_answer_failure(ProfChatWin *chatwin)
{
assert(chatwin != NULL);
win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "", "%s failed to authenticate you.", chatwin->barejid);
}
void
ui_otr_authenticating(ProfChatWin *chatwin)
{
assert(chatwin != NULL);
win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "", "Authenticating %s...", chatwin->barejid);
}
void
ui_otr_authetication_waiting(ProfChatWin *chatwin)
{
assert(chatwin != NULL);
win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "", "Awaiting authentication from %s...", chatwin->barejid);
}
void
ui_trust(ProfChatWin *chatwin)
{
assert(chatwin != NULL);
chatwin->is_otr = TRUE;
chatwin->otr_is_trusted = TRUE;
ProfWin *window = (ProfWin*)chatwin;
win_print(window, '!', 0, NULL, 0, THEME_OTR_TRUSTED, "", "OTR session trusted.");
if (wins_is_current(window)) {
title_bar_switch();
}
}
void
ui_smp_answer_failure(const char *const barejid)
ui_untrust(ProfChatWin *chatwin)
{
ProfChatWin *chatwin = wins_get_chat(barejid);
if (chatwin) {
win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "", "%s failed to authenticate you.", barejid);
}
}
assert(chatwin != NULL);
void
ui_otr_authenticating(const char *const barejid)
{
ProfChatWin *chatwin = wins_get_chat(barejid);
if (chatwin) {
win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "", "Authenticating %s...", barejid);
}
}
chatwin->is_otr = TRUE;
chatwin->otr_is_trusted = FALSE;
void
ui_otr_authetication_waiting(const char *const barejid)
{
ProfChatWin *chatwin = wins_get_chat(barejid);
if (chatwin) {
win_vprint((ProfWin*)chatwin, '!', 0, NULL, 0, 0, "", "Awaiting authentication from %s...", barejid);
ProfWin *window = (ProfWin*)chatwin;
win_print(window, '!', 0, NULL, 0, THEME_OTR_UNTRUSTED, "", "OTR session untrusted.");
if (wins_is_current(window)) {
title_bar_switch();
}
}
@@ -202,38 +228,6 @@ ui_handle_otr_error(const char *const barejid, const char *const message)
}
}
void
ui_trust(const char *const barejid)
{
ProfChatWin *chatwin = wins_get_chat(barejid);
if (chatwin) {
chatwin->is_otr = TRUE;
chatwin->otr_is_trusted = TRUE;
ProfWin *window = (ProfWin*)chatwin;
win_print(window, '!', 0, NULL, 0, THEME_OTR_TRUSTED, "", "OTR session trusted.");
if (wins_is_current(window)) {
title_bar_switch();
}
}
}
void
ui_untrust(const char *const barejid)
{
ProfChatWin *chatwin = wins_get_chat(barejid);
if (chatwin) {
chatwin->is_otr = TRUE;
chatwin->otr_is_trusted = FALSE;
ProfWin *window = (ProfWin*)chatwin;
win_print(window, '!', 0, NULL, 0, THEME_OTR_UNTRUSTED, "", "OTR session untrusted.");
if (wins_is_current(window)) {
title_bar_switch();
}
}
}
void
ui_recipient_gone(const char *const barejid, const char *const resource)
{

View File

@@ -64,8 +64,8 @@ void ui_sigwinch_handler(int sig);
void ui_gone_secure(ProfChatWin *chatwin, gboolean trusted);
void ui_gone_insecure(ProfChatWin *chatwin);
void ui_trust(const char *const barejid);
void ui_untrust(const char *const barejid);
void ui_trust(ProfChatWin *chatwin);
void ui_untrust(ProfChatWin *chatwin);
void ui_smp_recipient_initiated(ProfChatWin *chatwin);
void ui_smp_recipient_initiated_q(ProfChatWin *chatwin, const char *question);
@@ -74,11 +74,11 @@ void ui_smp_unsuccessful_sender(ProfChatWin *chatwin);
void ui_smp_unsuccessful_receiver(ProfChatWin *chatwin);
void ui_smp_aborted(ProfChatWin *chatwin);
void ui_smp_answer_success(const char *const barejid);
void ui_smp_answer_failure(const char *const barejid);
void ui_smp_answer_success(ProfChatWin *chatwin);
void ui_smp_answer_failure(ProfChatWin *chatwin);
void ui_otr_authenticating(const char *const barejid);
void ui_otr_authetication_waiting(const char *const recipient);
void ui_otr_authenticating(ProfChatWin *chatwin);
void ui_otr_authetication_waiting(ProfChatWin *chatwin);
void ui_handle_otr_error(const char *const barejid, const char *const message);