summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_history.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-11-26 05:03:20 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-11-26 05:03:20 +0000
commit78ea011bd205b2b7f538950d32935f93debd6040 (patch)
tree6af575b89b9dcc2900a64283bb87083f09049536 /protocols/VKontakte/src/vk_history.cpp
parentdb2ec6c60fc50ea7a66a9d782b1af1017df596ca (diff)
VKontakte:
more options for sync history on protocol online some code cleanup version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@11079 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_history.cpp')
-rw-r--r--protocols/VKontakte/src/vk_history.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp
index 2c85626843..1d77774198 100644
--- a/protocols/VKontakte/src/vk_history.cpp
+++ b/protocols/VKontakte/src/vk_history.cpp
@@ -144,14 +144,24 @@ void CVkProto::GetServerHistory(MCONTACT hContact, int iOffset, int iCount, int
void CVkProto::GetHistoryDlg(MCONTACT hContact, int iLastMsg)
{
debugLogA("CVkProto::GetHistoryDlg %d", iLastMsg);
-
- int lastmsgid = getDword(hContact, "lastmsgid", -1);
- if (lastmsgid == -1 || !IsOnline()) {
- setDword(hContact, "lastmsgid", iLastMsg);
- return;
+ int lastmsgid = -1;
+ switch (m_iSyncHistoryMetod){
+ case syncAuto:
+ lastmsgid = getDword(hContact, "lastmsgid", -1);
+ if (lastmsgid == -1 || !IsOnline()) {
+ setDword(hContact, "lastmsgid", iLastMsg);
+ return;
+ }
+ GetServerHistory(hContact, 0, MAXHISTORYMIDSPERONE, 0, lastmsgid);
+ break;
+ case sync1Days:
+ GetServerHistoryLastNDay(hContact, 1);
+ break;
+ case sync3Days:
+ GetServerHistoryLastNDay(hContact, 3);
+ break;
}
-
- GetServerHistory(hContact, 0, MAXHISTORYMIDSPERONE, 0, lastmsgid);
+
}
void CVkProto::OnReceiveHistoryMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)