summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_history.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-12-26 04:23:50 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-12-26 04:23:50 +0000
commitefee96cfd3e6318ed376363ab9781bd944940107 (patch)
tree65b7c778fb973910bd0dc8bc82b56e4e3c70b7e0 /protocols/VKontakte/src/vk_history.cpp
parentf323ef4e6b1fe263e5564c66da33bdef7eb5fdde (diff)
VKontakte:
add news&notification autoclear option code cleanup version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@11641 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/vk_history.cpp')
-rw-r--r--protocols/VKontakte/src/vk_history.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp
index 7474b512ea..5a7a1ece6b 100644
--- a/protocols/VKontakte/src/vk_history.cpp
+++ b/protocols/VKontakte/src/vk_history.cpp
@@ -99,23 +99,21 @@ INT_PTR __cdecl CVkProto::SvcGetServerHistoryLast90Day(WPARAM hContact, LPARAM)
void CVkProto::GetServerHistoryLastNDay(MCONTACT hContact, int NDay)
{
debugLogA("CVkProto::SvcGetServerHistoryLastNDay %d", NDay);
- if (!IsOnline())
- return;
- UINT iTime = time(NULL) - 60 * 60 * 24 * NDay;
+ time_t tTime = time(NULL) - 60 * 60 * 24 * NDay;
HANDLE hDBEvent = db_event_first(hContact);
while (hDBEvent) {
HANDLE hDBEventNext = db_event_next(hContact, hDBEvent);
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDBEvent, &dbei);
- if (dbei.timestamp > iTime)
+ if (dbei.timestamp > tTime)
db_event_delete(hContact, hDBEvent);
hDBEvent = hDBEventNext;
}
db_unset(hContact, m_szModuleName, "lastmsgid");
- GetServerHistory(hContact, 0, MAXHISTORYMIDSPERONE, iTime, 0);
+ GetServerHistory(hContact, 0, MAXHISTORYMIDSPERONE, tTime, 0);
}
void CVkProto::GetServerHistory(MCONTACT hContact, int iOffset, int iCount, int iTime, int iLastMsgId, bool once)