1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-01-03 14:57:42 -05:00

Added ui_win_error_line()

This commit is contained in:
James Booth 2015-04-29 23:16:28 +01:00
parent 665c34414d
commit 2e75e54460
4 changed files with 10 additions and 2 deletions

View File

@ -69,8 +69,7 @@ cl_ev_send_msg(ProfChatWin *chatwin, const char * const msg)
prof_otrsendres_t res = otr_on_message_send(chatwin->barejid, msg);
if (res != PROF_OTRSUCCESS) {
char *errmsg = otr_senderror_str(res);
// TODO reference passed window
ui_current_error_line(errmsg);
ui_win_error_line((ProfWin*)chatwin, errmsg);
}
#else
char *id = message_send_chat(chatwin->barejid, msg);

View File

@ -1296,6 +1296,12 @@ ui_current_print_formatted_line(const char show_char, int attrs, const char * co
g_string_free(fmt_msg, TRUE);
}
void
ui_win_error_line(ProfWin *window, const char * const msg)
{
win_print(window, '-', NULL, 0, THEME_ERROR, "", msg);
}
void
ui_current_error_line(const char * const msg)
{

View File

@ -106,6 +106,7 @@ ProfChatWin *ui_get_current_chat(void);
void ui_current_print_line(const char * const msg, ...);
void ui_current_print_formatted_line(const char show_char, int attrs, const char * const msg, ...);
void ui_current_error_line(const char * const msg);
void ui_win_error_line(ProfWin *window, const char * const msg);
win_type_t ui_win_type(int index);
void ui_close_win(int index);

View File

@ -171,6 +171,8 @@ void ui_current_print_formatted_line(const char show_char, int attrs, const char
}
void ui_current_error_line(const char * const msg) {}
void ui_win_error_line(ProfWin *window, const char * const msg) {}
win_type_t ui_win_type(int index)
{