about summary refs log tree commit diff stats
path: root/src/windows.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/windows.c')
-rw-r--r--src/windows.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/windows.c b/src/windows.c
index a303b3c7..6b0a85e3 100644
--- a/src/windows.c
+++ b/src/windows.c
@@ -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, 
@@ -899,6 +918,14 @@ _win_show_message(WINDOW *win, const char * const 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)
 {
     int rows, cols;