about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-04-21 01:34:43 +0100
committerJames Booth <boothj5@gmail.com>2013-04-21 01:34:43 +0100
commit9de4ab6bb953f6f94fce601e28af46352207599d (patch)
treee28a88dfd7d5ca9a340bd306f4793c95d5a28a57
parentbb0f4a3fb2a9d3f11e4bd7d62c53e68491fc0f02 (diff)
downloadprofani-tty-9de4ab6bb953f6f94fce601e28af46352207599d.tar.gz
Moved cons_bad_show() to console module
-rw-r--r--src/ui/console.c25
-rw-r--r--src/ui/windows.c21
2 files changed, 25 insertions, 21 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index 79d15add..1f31248f 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -1134,6 +1134,31 @@ cons_show_contacts(GSList *list)
         }
         curr = g_slist_next(curr);
     }
+
+    dirty = TRUE;
+    if (!win_current_is_console()) {
+        status_bar_new(0);
+    }
+}
+
+void
+cons_bad_show(const char * const msg, ...)
+{
+    va_list arg;
+    va_start(arg, msg);
+    GString *fmt_msg = g_string_new(NULL);
+    g_string_vprintf(fmt_msg, msg, arg);
+    window_show_time(console, '-');
+    wattron(console->win, COLOUR_ERROR);
+    wprintw(console->win, "%s\n", fmt_msg->str);
+    wattroff(console->win, COLOUR_ERROR);
+    g_string_free(fmt_msg, TRUE);
+    va_end(arg);
+
+    dirty = TRUE;
+    if (!win_current_is_console()) {
+        status_bar_new(0);
+    }
 }
 
 static void
diff --git a/src/ui/windows.c b/src/ui/windows.c
index 14b4b34e..c027eed2 100644
--- a/src/ui/windows.c
+++ b/src/ui/windows.c
@@ -1146,27 +1146,6 @@ win_room_show_status(const char * const contact)
 }
 
 void
-cons_bad_show(const char * const msg, ...)
-{
-    va_list arg;
-    va_start(arg, msg);
-    GString *fmt_msg = g_string_new(NULL);
-    g_string_vprintf(fmt_msg, msg, arg);
-    window_show_time(console, '-');
-    wattron(console->win, COLOUR_ERROR);
-    wprintw(console->win, "%s\n", fmt_msg->str);
-    wattroff(console->win, COLOUR_ERROR);
-    g_string_free(fmt_msg, TRUE);
-    va_end(arg);
-
-    if (current_index == 0) {
-        dirty = TRUE;
-    } else {
-        status_bar_new(0);
-    }
-}
-
-void
 cons_show_time(void)
 {
     window_show_time(console, '-');