about summary refs log tree commit diff stats
path: root/src/windows.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-10-04 23:33:38 +0100
committerJames Booth <boothj5@gmail.com>2012-10-04 23:33:38 +0100
commit9f08744ec0b11123a610b82ab0f596e125098ba1 (patch)
tree876a670fa7dbb9621d2a2e01f92dff8b2e99a08c /src/windows.c
parente486114e05b30357a96076c98d8423e962d8f491 (diff)
downloadprofani-tty-9f08744ec0b11123a610b82ab0f596e125098ba1.tar.gz
Show warning when sending message to offline contact
Diffstat (limited to 'src/windows.c')
-rw-r--r--src/windows.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/windows.c b/src/windows.c
index 872a3617..c2c07015 100644
--- a/src/windows.c
+++ b/src/windows.c
@@ -370,6 +370,13 @@ win_show_outgoing_msg(const char * const from, const char * const to,
             win_index = _new_prof_win(to);
 
         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");
+        }
+
         _win_show_time(win);
         _win_show_user(win, from, 0);
         _win_show_message(win, message);
@@ -898,7 +905,7 @@ _show_status_string(WINDOW *win, const char * const from,
     const char * const default_show)
 {
     _win_show_time(win);    
-
+    
     if (show != NULL) {
         if (strcmp(show, "away") == 0) {
             wattron(win, COLOUR_AWAY);
@@ -926,8 +933,8 @@ _show_status_string(WINDOW *win, const char * const from,
         wprintw(win, ", \"%s\"", status);
     
     wprintw(win, "\n");
-    
-    if (show != NULL) {
+   
+    if (show != NULL) { 
         if (strcmp(show, "away") == 0) {
             wattroff(win, COLOUR_AWAY);
         } else if (strcmp(show, "chat") == 0) {