diff options
author | aunsane <aunsane@gmail.com> | 2018-04-21 22:34:54 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2018-04-21 22:35:11 +0300 |
commit | 1383e88abf16de34fb680dfb5001ba79d44d933c (patch) | |
tree | 49542a89a49ac78693e00de6c66d865430d47ab3 /plugins | |
parent | a74debb40c3df12738c722548c556a97e5976036 (diff) |
core: add Contact_GetStatus function
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CloudFile/src/stdafx.h | 1 | ||||
-rw-r--r-- | plugins/CloudFile/src/utils.cpp | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/plugins/CloudFile/src/stdafx.h b/plugins/CloudFile/src/stdafx.h index 6edf174305..7a54a943b9 100644 --- a/plugins/CloudFile/src/stdafx.h +++ b/plugins/CloudFile/src/stdafx.h @@ -30,6 +30,7 @@ #include <m_metacontacts.h> #include <m_protoint.h> #include <m_protosvc.h> +#include <m_contacts.h> #include <m_cloudfile.h> diff --git a/plugins/CloudFile/src/utils.cpp b/plugins/CloudFile/src/utils.cpp index 65fd99e376..ec5bc04d10 100644 --- a/plugins/CloudFile/src/utils.cpp +++ b/plugins/CloudFile/src/utils.cpp @@ -49,11 +49,11 @@ bool CanSendToContact(MCONTACT hContact) if (!canSend) return false; - bool isProtoOffline = Proto_GetStatus(proto) <= ID_STATUS_OFFLINE; - if (isProtoOffline) + bool isProtoOnline = Proto_GetStatus(proto) > ID_STATUS_OFFLINE; + if (!isProtoOnline) return false; - bool isContactOnline = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE) > ID_STATUS_OFFLINE; + bool isContactOnline = Contact_GetStatus(hContact) > ID_STATUS_OFFLINE; if (isContactOnline) return true; |