about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-04-18 23:40:35 +0100
committerJames Booth <boothj5@gmail.com>2014-04-18 23:40:35 +0100
commit8f2c0a66bfeb4ac38989b31fbaaf83f1dd7017e6 (patch)
tree289604f6f0de0fdb108395000f5865c8058fae5a /src
parentfadad0aeba3258677d1eefa303be5a54fafdda03 (diff)
downloadprofani-tty-8f2c0a66bfeb4ac38989b31fbaaf83f1dd7017e6.tar.gz
Handle subscription on otr message sends
Diffstat (limited to 'src')
-rw-r--r--src/otr/otr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/otr/otr.c b/src/otr/otr.c
index 2cb86695..73ce8966 100644
--- a/src/otr/otr.c
+++ b/src/otr/otr.c
@@ -53,10 +53,18 @@ cb_is_logged_in(void *opdata, const char *accountname,
     const char *protocol, const char *recipient)
 {
     PContact contact = roster_get_contact(recipient);
+
+    // not in roster
     if (contact == NULL) {
         return PRESENCE_ONLINE;
     }
 
+    // no subsribed
+    if (p_contact_subscribed(contact) == FALSE) {
+        return PRESENCE_ONLINE;
+    }
+
+    // subscribed
     if (g_strcmp0(p_contact_presence(contact), "offline") == 0) {
         return PRESENCE_OFFLINE;
     } else {