about summary refs log tree commit diff stats
path: root/src/server_events.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/server_events.c')
-rw-r--r--src/server_events.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server_events.c b/src/server_events.c
index d8943885..23e4fce3 100644
--- a/src/server_events.c
+++ b/src/server_events.c
@@ -315,11 +315,17 @@ handle_contact_online(char *barejid, Resource *resource,
 {
     gboolean updated = roster_update_presence(barejid, resource, last_activity);
 
-    if (updated && prefs_get_boolean(PREF_STATUSES)) {
+    if (updated) {
+        char *show_console = prefs_get_string(PREF_STATUSES_CONSOLE);
         PContact contact = roster_get_contact(barejid);
         if (p_contact_subscription(contact) != NULL) {
             if (strcmp(p_contact_subscription(contact), "none") != 0) {
-                cons_show_contact_online(contact, resource, last_activity);
+                if (g_strcmp0(show_console, "all") == 0) {
+                    cons_show_contact_online(contact, resource, last_activity);
+                } else if (g_strcmp0(show_console, "online") == 0 &&
+                        resource->presence == RESOURCE_ONLINE) {
+                    cons_show_contact_online(contact, resource, last_activity);
+                }
                 ui_chat_win_contact_online(contact, resource, last_activity);
             }
         }