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.c80
1 files changed, 46 insertions, 34 deletions
diff --git a/src/windows.c b/src/windows.c
index f1c8f0fe..c7e49020 100644
--- a/src/windows.c
+++ b/src/windows.c
@@ -427,8 +427,8 @@ win_show_outgoing_msg(const char * const from, const char * const to,
         }
 
         if (contact != NULL) {
-            if (strcmp(p_contact_show(contact), "offline") == 0) {
-                const char const *show = p_contact_show(contact);
+            if (strcmp(p_contact_presence(contact), "offline") == 0) {
+                const char const *show = p_contact_presence(contact);
                 const char const *status = p_contact_status(contact);
                 _show_status_string(win, to, show, status, "--", "offline");
             }
@@ -703,44 +703,56 @@ cons_show_contacts(GSList *list)
 
     while(curr) {
         PContact contact = curr->data;
-        const char *show = p_contact_show(contact);
+        const char *jid = p_contact_jid(contact);
+        const char *name = p_contact_name(contact);
+        const char *presence = p_contact_presence(contact);
+        const char *status = p_contact_status(contact);
+        const char *sub = p_contact_subscription(contact);
 
-        _win_show_time(_cons_win);
+        if (strcmp(sub, "none") != 0) {
+            _win_show_time(_cons_win);
 
-        if (strcmp(show, "online") == 0) {
-            wattron(_cons_win, COLOUR_ONLINE);
-        } else if (strcmp(show, "away") == 0) {
-            wattron(_cons_win, COLOUR_AWAY);
-        } else if (strcmp(show, "chat") == 0) {
-            wattron(_cons_win, COLOUR_CHAT);
-        } else if (strcmp(show, "dnd") == 0) {
-            wattron(_cons_win, COLOUR_DND);
-        } else if (strcmp(show, "xa") == 0) {
-            wattron(_cons_win, COLOUR_XA);
-        } else {
-            wattron(_cons_win, COLOUR_OFFLINE);
-        }
+            if (strcmp(presence, "online") == 0) {
+                wattron(_cons_win, COLOUR_ONLINE);
+            } else if (strcmp(presence, "away") == 0) {
+                wattron(_cons_win, COLOUR_AWAY);
+            } else if (strcmp(presence, "chat") == 0) {
+                wattron(_cons_win, COLOUR_CHAT);
+            } else if (strcmp(presence, "dnd") == 0) {
+                wattron(_cons_win, COLOUR_DND);
+            } else if (strcmp(presence, "xa") == 0) {
+                wattron(_cons_win, COLOUR_XA);
+            } else {
+                wattron(_cons_win, COLOUR_OFFLINE);
+            }
+
+            wprintw(_cons_win, "%s", jid);
 
-        wprintw(_cons_win, "%s", p_contact_name(contact));
-        wprintw(_cons_win, " is %s", show);
+            if (name != NULL) {
+                wprintw(_cons_win, " (%s)", name);
+            }
 
-        if (p_contact_status(contact))
-            wprintw(_cons_win, ", \"%s\"", p_contact_status(contact));
+            wprintw(_cons_win, " is %s", presence);
 
-        wprintw(_cons_win, "\n");
+            if (status != NULL) {
+                wprintw(_cons_win, ", \"%s\"", p_contact_status(contact));
+            }
 
-        if (strcmp(show, "online") == 0) {
-            wattroff(_cons_win, COLOUR_ONLINE);
-        } else if (strcmp(show, "away") == 0) {
-            wattroff(_cons_win, COLOUR_AWAY);
-        } else if (strcmp(show, "chat") == 0) {
-            wattroff(_cons_win, COLOUR_CHAT);
-        } else if (strcmp(show, "dnd") == 0) {
-            wattroff(_cons_win, COLOUR_DND);
-        } else if (strcmp(show, "xa") == 0) {
-            wattroff(_cons_win, COLOUR_XA);
-        } else {
-            wattroff(_cons_win, COLOUR_OFFLINE);
+            wprintw(_cons_win, "\n");
+
+            if (strcmp(presence, "online") == 0) {
+                wattroff(_cons_win, COLOUR_ONLINE);
+            } else if (strcmp(presence, "away") == 0) {
+                wattroff(_cons_win, COLOUR_AWAY);
+            } else if (strcmp(presence, "chat") == 0) {
+                wattroff(_cons_win, COLOUR_CHAT);
+            } else if (strcmp(presence, "dnd") == 0) {
+                wattroff(_cons_win, COLOUR_DND);
+            } else if (strcmp(presence, "xa") == 0) {
+                wattroff(_cons_win, COLOUR_XA);
+            } else {
+                wattroff(_cons_win, COLOUR_OFFLINE);
+            }
         }
 
         curr = g_slist_next(curr);