about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-04-21 01:47:57 +0100
committerJames Booth <boothj5@gmail.com>2013-04-21 01:47:57 +0100
commite151ce707d822f4e7258353b4f94e154b123b4ad (patch)
tree10c41f922cddff437bff8bbd1aa6a2c405c46b3e
parent8a280b43cac0e84cede288a1816cd0ee2324782b (diff)
downloadprofani-tty-e151ce707d822f4e7258353b4f94e154b123b4ad.tar.gz
Moved remaining static functions to console module
-rw-r--r--src/ui/console.c18
-rw-r--r--src/ui/ui.h2
-rw-r--r--src/ui/windows.c29
3 files changed, 24 insertions, 25 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index 0bea782d..aa74f9ec 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -153,6 +153,24 @@ cons_bad_command(const char * const cmd)
 }
 
 void
+cons_show_typing(const char * const short_from)
+{
+    window_show_time(console, '-');
+    wattron(console->win, COLOUR_TYPING);
+    wprintw(console->win, "!! %s is typing a message...\n", short_from);
+    wattroff(console->win, COLOUR_TYPING);
+}
+
+void
+cons_show_incoming_message(const char * const short_from, const int win_index)
+{
+    window_show_time(console, '-');
+    wattron(console->win, COLOUR_INCOMING);
+    wprintw(console->win, "<< incoming from %s (%d)\n", short_from, win_index + 1);
+    wattroff(console->win, COLOUR_INCOMING);
+}
+
+void
 cons_about(void)
 {
     int rows, cols;
diff --git a/src/ui/ui.h b/src/ui/ui.h
index de217006..9ead3848 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -166,6 +166,8 @@ void cons_show_disco_info(const char *from, GSList *identities, GSList *features
 void cons_show_room_invite(const char * const invitor, const char * const room,
     const char * const reason);
 void cons_check_version(gboolean not_available_msg);
+void cons_show_typing(const char * const short_from);
+void cons_show_incoming_message(const char * const short_from, const int win_index);
 
 // status bar actions
 void status_bar_refresh(void);
diff --git a/src/ui/windows.c b/src/ui/windows.c
index 8d9f6b5d..31660fc2 100644
--- a/src/ui/windows.c
+++ b/src/ui/windows.c
@@ -83,9 +83,6 @@ static void _show_status_string(ProfWin *window, const char * const from,
     const char * const show, const char * const status,
     GDateTime *last_activity, const char * const pre,
     const char * const default_show);
-static void _cons_show_typing(const char * const short_from);
-static void _cons_show_incoming_message(const char * const short_from,
-    const int win_index);
 static void _win_handle_switch(const wint_t * const ch);
 static void _win_handle_page(const wint_t * const ch);
 static void _win_resize_all(void);
@@ -266,11 +263,11 @@ ui_show_typing(const char * const from)
     if (prefs_get_boolean(PREF_INTYPE)) {
         // no chat window for user
         if (win_index == NUM_WINS) {
-            _cons_show_typing(from);
+            cons_show_typing(from);
 
         // have chat window but not currently in it
         } else if (win_index != current_index) {
-            _cons_show_typing(from);
+            cons_show_typing(from);
             dirty = TRUE;
 
         // in chat window with user
@@ -400,7 +397,7 @@ ui_show_incoming_msg(const char * const from, const char * const message,
         // not currently viewing chat window with sender
         } else {
             status_bar_new(win_index);
-            _cons_show_incoming_message(from, win_index);
+            cons_show_incoming_message(from, win_index);
             if (prefs_get_boolean(PREF_FLASH))
                 flash();
 
@@ -1034,7 +1031,7 @@ win_show_room_message(const char * const room_jid, const char * const nick,
     // not currenlty on groupchat window
     } else {
         status_bar_new(win_index);
-        _cons_show_incoming_message(nick, win_index);
+        cons_show_incoming_message(nick, win_index);
         if (current_index == 0) {
             dirty = TRUE;
         }
@@ -1415,24 +1412,6 @@ _show_status_string(ProfWin *window, const char * const from,
 }
 
 static void
-_cons_show_typing(const char * const short_from)
-{
-    window_show_time(console, '-');
-    wattron(console->win, COLOUR_TYPING);
-    wprintw(console->win, "!! %s is typing a message...\n", short_from);
-    wattroff(console->win, COLOUR_TYPING);
-}
-
-static void
-_cons_show_incoming_message(const char * const short_from, const int win_index)
-{
-    window_show_time(console, '-');
-    wattron(console->win, COLOUR_INCOMING);
-    wprintw(console->win, "<< incoming from %s (%d)\n", short_from, win_index + 1);
-    wattroff(console->win, COLOUR_INCOMING);
-}
-
-static void
 _win_handle_switch(const wint_t * const ch)
 {
     if (*ch == KEY_F(1)) {