summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2018-04-21 22:34:54 +0300
committeraunsane <aunsane@gmail.com>2018-04-21 22:35:11 +0300
commit1383e88abf16de34fb680dfb5001ba79d44d933c (patch)
tree49542a89a49ac78693e00de6c66d865430d47ab3 /src
parenta74debb40c3df12738c722548c556a97e5976036 (diff)
core: add Contact_GetStatus function
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/contacts.cpp13
-rw-r--r--src/mir_app/src/mir_app.def1
2 files changed, 14 insertions, 0 deletions
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