diff options
author | James Booth <boothj5@gmail.com> | 2014-04-18 23:40:35 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-04-18 23:40:35 +0100 |
commit | 8f2c0a66bfeb4ac38989b31fbaaf83f1dd7017e6 (patch) | |
tree | 289604f6f0de0fdb108395000f5865c8058fae5a | |
parent | fadad0aeba3258677d1eefa303be5a54fafdda03 (diff) | |
download | profani-tty-8f2c0a66bfeb4ac38989b31fbaaf83f1dd7017e6.tar.gz |
Handle subscription on otr message sends
-rw-r--r-- | src/otr/otr.c | 8 |
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 { |