about summary refs log tree commit diff stats
path: root/src/ui/titlebar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/titlebar.c')
-rw-r--r--src/ui/titlebar.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/ui/titlebar.c b/src/ui/titlebar.c
index 41715811..5894e0ac 100644
--- a/src/ui/titlebar.c
+++ b/src/ui/titlebar.c
@@ -403,15 +403,18 @@ _show_contact_presence(ProfChatWin *chatwin)
         theme_item_t presence_colour = THEME_TITLE_OFFLINE;
         const char *presence = "offline";
 
-        PContact contact = roster_get_contact(chatwin->barejid);
-        if (contact) {
-            if (resource) {
-                Resource *resourcep = p_contact_get_resource(contact, resource);
-                if (resourcep) {
-                    presence = string_from_resource_presence(resourcep->presence);
+        jabber_conn_status_t conn_status = jabber_get_connection_status();
+        if (conn_status == JABBER_CONNECTED) {
+            PContact contact = roster_get_contact(chatwin->barejid);
+            if (contact) {
+                if (resource) {
+                    Resource *resourcep = p_contact_get_resource(contact, resource);
+                    if (resourcep) {
+                        presence = string_from_resource_presence(resourcep->presence);
+                    }
+                } else {
+                    presence = p_contact_presence(contact);
                 }
-            } else {
-                presence = p_contact_presence(contact);
             }
         }