summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src
diff options
context:
space:
mode:
authorElzorFox <elzorfox@ya.ru>2022-06-21 09:23:37 +0500
committerElzorFox <elzorfox@ya.ru>2022-06-21 09:23:37 +0500
commitf1e6512f2f24a9cde4beed2462a97aceca82832a (patch)
tree1215712df640f74bc27806cebceea427970dfd74 /protocols/VKontakte/src
parentffe69ec8074d9243b3f1737f4b24afa06ae55da8 (diff)
VKontakte: GetAwayMsg implementation
Diffstat (limited to 'protocols/VKontakte/src')
-rw-r--r--protocols/VKontakte/src/vk_proto.h2
-rw-r--r--protocols/VKontakte/src/vk_status.cpp17
2 files changed, 18 insertions, 1 deletions
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h
index 707db3f405..f5bf492d6c 100644
--- a/protocols/VKontakte/src/vk_proto.h
+++ b/protocols/VKontakte/src/vk_proto.h
@@ -58,6 +58,7 @@ struct CVkProto : public PROTO<CVkProto>
int AuthRequest(MCONTACT hContact, const wchar_t *szMessage) override;
INT_PTR GetCaps(int type, MCONTACT hContact = 0) override;
int GetInfo(MCONTACT hContact, int infoType) override;
+ HANDLE GetAwayMsg(MCONTACT hContact) override;
HANDLE SearchBasic(const wchar_t *id) override;
HANDLE SearchByEmail(const wchar_t *email) override;
HANDLE SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName) override;
@@ -413,6 +414,7 @@ private:
void SetChatStatus(MCONTACT hContact, int iStatus);
CVkChatInfo* GetChatById(LPCWSTR pwszId);
INT_PTR __cdecl SvcCreateChat(WPARAM, LPARAM);
+ void __cdecl GetAwayMsgThread(void* p);
};
struct CMPlugin : public ACCPROTOPLUGIN<CVkProto>
diff --git a/protocols/VKontakte/src/vk_status.cpp b/protocols/VKontakte/src/vk_status.cpp
index f759aff825..34d41bc55a 100644
--- a/protocols/VKontakte/src/vk_status.cpp
+++ b/protocols/VKontakte/src/vk_status.cpp
@@ -230,4 +230,19 @@ INT_PTR __cdecl CVkProto::SvcSetListeningTo(WPARAM, LPARAM lParam)
}
RetrieveStatusMusic(wszListeningTo);
return 0;
-} \ No newline at end of file
+}
+
+HANDLE CVkProto::GetAwayMsg(MCONTACT hContact)
+{
+ ForkThread(&CVkProto::GetAwayMsgThread, (void *)hContact);
+ return (HANDLE)1;
+}
+
+void CVkProto::GetAwayMsgThread(void* p)
+{
+ Sleep(100);
+
+ MCONTACT hContact = (DWORD_PTR)p;
+ ptrW wszStatus(db_get_wsa(hContact, "CList", "StatusMsg"));
+ ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, wszStatus);
+}