diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-09-03 04:17:28 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-09-03 04:17:28 +0000 |
commit | 813694abc5792d7cc6f4a39d42d3619af3f5e996 (patch) | |
tree | 83050371b79b9543d91a34bc4b8533f32376e438 /protocols/VKontakte/src/vk_proto.cpp | |
parent | 25f61751aafa9f30a26cdf10a212d14103ebb810 (diff) |
VKontakte:
Add sync history support
Add mark read on reply option
Add always notify as unread for all incoming message option
Version bump
git-svn-id: http://svn.miranda-ng.org/main/trunk@10357 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_proto.cpp')
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 6d36ad8d0b..f08e004b08 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -54,6 +54,9 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) : m_bServerDelivery = getBool("ServerDelivery", true);
m_bHideChats = getBool("HideChats", true);
+ m_bMesAsUnread = getBool("MesAsUnread", false);
+ m_bMarkReadOnReply = getBool("MarkReadOnReply", false);
+ m_bAutoSyncHistory = getBool("AutoSyncHistory", true);
// Set all contacts offline -- in case we crashed
SetAllContactStatuses(ID_STATUS_OFFLINE);
@@ -91,6 +94,20 @@ int CVkProto::OnModulesLoaded(WPARAM wParam, LPARAM lParam) mi.icolibItem = LoadSkinnedIconHandle(SKINICON_CHAT_JOIN);
mi.pszName = LPGEN("Create new chat");
Menu_AddProtoMenuItem(&mi);
+
+ //Server History
+ CreateProtoService(PS_GETALLSERVERHISTORY, &CVkProto::SvcGetAllServerHistory);
+
+ mir_snprintf(szService, sizeof(szService), "%s%s", m_szModuleName, PS_GETALLSERVERHISTORY);
+ mi.pszService = szService;
+ mi.pszContactOwner = m_szModuleName;
+ mi.flags = CMIF_TCHAR;
+ mi.position = -200001000+1;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_HISTORY);
+ mi.position = -201001000+102;
+ mi.ptszName = LPGENT("Reload all messages from vk.com");
+ Menu_AddContactMenuItem(&mi);
+
return 0;
}
@@ -201,7 +218,12 @@ void CVkProto::OnSendMessage(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) JSONROOT pRoot;
JSONNODE *pResponse = CheckJsonResponse(pReq, reply, pRoot);
if (pResponse != NULL) {
- m_sendIds.insert((HANDLE)json_as_int(pResponse));
+ UINT mid = json_as_int(pResponse);
+ m_sendIds.insert((HANDLE)mid);
+ if (mid>getDword(param->hContact, "lastmsgid", 0))
+ setDword(param->hContact, "lastmsgid", mid);
+ if (m_bMarkReadOnReply)
+ MarkMessagesRead(param->hContact);
iResult = ACKRESULT_SUCCESS;
}
}
|