mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-25 20:06:21 +00:00
handle error messages from server
This commit is contained in:
@@ -73,6 +73,7 @@ static void _win_switch_if_active(const int i);
|
||||
static void _win_show_time(WINDOW *win);
|
||||
static void _win_show_user(WINDOW *win, const char * const user, const int colour);
|
||||
static void _win_show_message(WINDOW *win, const char * const message);
|
||||
static void _win_show_error_msg(WINDOW *win, const char * const message);
|
||||
static void _show_status_string(WINDOW *win, const char * const from,
|
||||
const char * const show, const char * const status, const char * const pre,
|
||||
const char * const default_show);
|
||||
@@ -302,6 +303,24 @@ win_show_incomming_msg(const char * const from, const char * const message)
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
win_show_error_msg(const char * const from, const char *err_msg)
|
||||
{
|
||||
int win_index;
|
||||
WINDOW *win;
|
||||
|
||||
if (from == NULL || err_msg == NULL)
|
||||
return;
|
||||
|
||||
win_index = _find_prof_win_index(from);
|
||||
// chat window exists
|
||||
if (win_index < NUM_WINS) {
|
||||
win = _wins[win_index].win;
|
||||
_win_show_time(win);
|
||||
_win_show_error_msg(win, err_msg);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_LIBNOTIFY
|
||||
static void
|
||||
_win_notify(const char * const message, int timeout,
|
||||
@@ -898,6 +917,14 @@ _win_show_message(WINDOW *win, const char * const message)
|
||||
wprintw(win, "%s\n", message);
|
||||
}
|
||||
|
||||
static void
|
||||
_win_show_error_msg(WINDOW *win, const char * const message)
|
||||
{
|
||||
wattron(win, COLOUR_ERR);
|
||||
wprintw(win, "%s\n", message);
|
||||
wattroff(win, COLOUR_ERR);
|
||||
}
|
||||
|
||||
static void
|
||||
_current_window_refresh(void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user