about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-10-04 23:55:15 +0100
committerJames Booth <boothj5@gmail.com>2012-10-04 23:55:15 +0100
commitd493975d54b70060e618212c69fe7d9bdb8dda22 (patch)
tree07a701e5b6bf07b48dead822e7703db415b4c978 /src
parentc9afe7b3462aafe898b90cad2febd7bc8ae06682 (diff)
downloadprofani-tty-d493975d54b70060e618212c69fe7d9bdb8dda22.tar.gz
Only show offline warning once
Diffstat (limited to 'src')
-rw-r--r--src/windows.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/windows.c b/src/windows.c
index effd7e6a..0c249b9a 100644
--- a/src/windows.c
+++ b/src/windows.c
@@ -365,16 +365,19 @@ win_show_outgoing_msg(const char * const from, const char * const to,
         cons_show("%s is not one of your contacts.");
     } else {
         int win_index = _find_prof_win_index(to);
+        WINDOW *win = NULL;
 
-        if (win_index == NUM_WINS) 
+        if (win_index == NUM_WINS) {
             win_index = _new_prof_win(to);
+            win = _wins[win_index].win;
 
-        WINDOW *win = _wins[win_index].win;
-
-        if (strcmp(p_contact_show(contact), "offline") == 0) {
-            const char const *show = p_contact_show(contact);
-            const char const *status = p_contact_status(contact);
-            _show_status_string(win, to, show, status, "--", "offline");
+            if (strcmp(p_contact_show(contact), "offline") == 0) {
+                const char const *show = p_contact_show(contact);
+                const char const *status = p_contact_status(contact);
+                _show_status_string(win, to, show, status, "--", "offline");
+            }
+        } else {
+            win = _wins[win_index].win;
         }
 
         _win_show_time(win);