From 1383e88abf16de34fb680dfb5001ba79d44d933c Mon Sep 17 00:00:00 2001 From: aunsane Date: Sat, 21 Apr 2018 22:34:54 +0300 Subject: core: add Contact_GetStatus function --- plugins/CloudFile/src/stdafx.h | 1 + plugins/CloudFile/src/utils.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins') 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 #include #include +#include #include 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; -- cgit v1.2.3