Return result on OTR message sending

This commit is contained in:
James Booth
2015-04-29 22:59:44 +01:00
parent 0df8b8beff
commit 665c34414d
11 changed files with 75 additions and 50 deletions

View File

@@ -110,7 +110,7 @@ cmd_execute_default(const char * inp)
case WIN_CHAT:
{
ProfChatWin *chatwin = wins_get_current_chat();
cl_ev_send_msg(chatwin->barejid, inp);
cl_ev_send_msg(chatwin, inp);
break;
}
case WIN_PRIVATE:
@@ -1327,23 +1327,23 @@ cmd_msg(gchar **args, struct cmd_help_t help)
barejid = usr;
}
if (msg) {
cl_ev_send_msg(barejid, msg);
return TRUE;
} else {
ProfWin *window = (ProfWin*)wins_get_chat(barejid);
if (!window) {
window = ui_ev_new_chat_win(barejid);
}
ui_ev_focus_win(window);
ProfChatWin *chatwin = wins_get_chat(barejid);
if (!chatwin) {
chatwin = ui_ev_new_chat_win(barejid);
}
ui_ev_focus_win((ProfWin*)chatwin);
if (msg) {
cl_ev_send_msg(chatwin, msg);
} else {
#ifdef HAVE_LIBOTR
if (otr_is_secure(barejid)) {
ui_gone_secure(barejid, otr_is_trusted(barejid));
}
#endif
return TRUE;
}
return TRUE;
}
}
@@ -3141,7 +3141,7 @@ cmd_tiny(gchar **args, struct cmd_help_t help)
case WIN_CHAT:
{
ProfChatWin *chatwin = wins_get_current_chat();
cl_ev_send_msg(chatwin->barejid, tiny);
cl_ev_send_msg(chatwin, tiny);
break;
}
case WIN_PRIVATE:
@@ -4169,11 +4169,11 @@ cmd_otr(gchar **args, struct cmd_help_t help)
barejid = contact;
}
ProfWin *window = (ProfWin*)wins_get_chat(barejid);
if (!window) {
window = ui_ev_new_chat_win(barejid);
ProfChatWin *chatwin = wins_get_chat(barejid);
if (!chatwin) {
chatwin = ui_ev_new_chat_win(barejid);
}
ui_ev_focus_win(window);
ui_ev_focus_win((ProfWin*)chatwin);
if (ui_current_win_is_otr()) {
ui_current_print_formatted_line('!', 0, "You are already in an OTR session.");