summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/m_contacts.h4
-rw-r--r--libs/win32/mir_app.libbin157574 -> 157804 bytes
-rw-r--r--plugins/CloudFile/src/stdafx.h1
-rw-r--r--plugins/CloudFile/src/utils.cpp6
-rw-r--r--src/mir_app/src/contacts.cpp13
-rw-r--r--src/mir_app/src/mir_app.def1
6 files changed, 21 insertions, 4 deletions
diff --git a/include/m_contacts.h b/include/m_contacts.h
index 779582878f..a8463ee43c 100644
--- a/include/m_contacts.h
+++ b/include/m_contacts.h
@@ -79,6 +79,8 @@ EXTERN_C MIR_APP_DLL(wchar_t*) Contact_GetInfo(
MCONTACT hContact, // contact id or NULL for the global data
const char *szProto = nullptr); // protocol for global data. if skipped, grabbed from hContact
+EXTERN_C MIR_APP_DLL(int) Contact_GetStatus(MCONTACT hContact);
+
/////////////////////////////////////////////////////////////////////////////////////////
// Add contact's dialog
@@ -86,6 +88,6 @@ EXTERN_C MIR_APP_DLL(wchar_t*) Contact_GetInfo(
EXTERN_C MIR_APP_DLL(void) Contact_Add(MCONTACT hContact, HWND hwndParent = nullptr);
EXTERN_C MIR_APP_DLL(void) Contact_AddByEvent(MEVENT hEvent, HWND hwndParent = nullptr);
-EXTERN_C MIR_APP_DLL(void) Contact_AddBySearch(const char *m_szProto, struct PROTOSEARCHRESULT *m_psr, HWND hwndParent = nullptr);
+EXTERN_C MIR_APP_DLL(void) Contact_AddBySearch(const char *szProto, struct PROTOSEARCHRESULT *psr, HWND hwndParent = nullptr);
#endif // M_CONTACTS_H__
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib
index 0315eeafe2..aba422d92b 100644
--- a/libs/win32/mir_app.lib
+++ b/libs/win32/mir_app.lib
Binary files differ
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;
diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp
index b53fb0bcd5..2f52b6ca91 100644
--- a/src/mir_app/src/contacts.cpp
+++ b/src/mir_app/src/contacts.cpp
@@ -285,6 +285,19 @@ MIR_APP_DLL(wchar_t*) Contact_GetInfo(int type, MCONTACT hContact, const char *s
return nullptr;
}
+MIR_APP_DLL(int) Contact_GetStatus(MCONTACT hContact)
+{
+ if (hContact == 0)
+ return ID_STATUS_OFFLINE;
+
+ const char *szProto = GetContactProto(hContact);
+ if (szProto == nullptr)
+ return ID_STATUS_OFFLINE;
+
+ return db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+}
+
+
/////////////////////////////////////////////////////////////////////////////////////////
// Options dialog
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index ec0240613f..f8b2c787d4 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -583,3 +583,4 @@ Proto_GetStatus @601
?IsReadyToExit@PROTO_INTERFACE@@UAE_NXZ @606 NONAME
?OnModulesLoaded@PROTO_INTERFACE@@UAEXXZ @607 NONAME
?OnShutdown@PROTO_INTERFACE@@UAEXXZ @608 NONAME
+Contact_GetStatus @609