about summary refs log tree commit diff stats
path: root/src/otr
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-01-05 00:06:50 +0000
committerJames Booth <boothj5@gmail.com>2016-01-05 00:06:50 +0000
commit055a5f71ce38c87ea1c97d475fd870ee25148ea9 (patch)
treec8fde96dcdfeea12052cd730d6733545e8e1d35f /src/otr
parent8e9bf083895ba7101115594a39dace62a59ab28f (diff)
downloadprofani-tty-055a5f71ce38c87ea1c97d475fd870ee25148ea9.tar.gz
Added roster struct, create and destroy roster on connect/disconnect
Diffstat (limited to 'src/otr')
-rw-r--r--src/otr/otr.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/otr/otr.c b/src/otr/otr.c
index 878f2edd..d898e740 100644
--- a/src/otr/otr.c
+++ b/src/otr/otr.c
@@ -84,9 +84,13 @@ cb_policy(void *opdata, ConnContext *context)
 }
 
 static int
-cb_is_logged_in(void *opdata, const char *accountname,
-    const char *protocol, const char *recipient)
+cb_is_logged_in(void *opdata, const char *accountname, const char *protocol, const char *recipient)
 {
+    jabber_conn_status_t conn_status = jabber_get_connection_status();
+    if (conn_status != JABBER_CONNECTED) {
+        return PRESENCE_OFFLINE;
+    }
+
     PContact contact = roster_get_contact(recipient);
 
     // not in roster