From 6b9cbcc049b4c580ffac4e39be8d97d73b58c80a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 14 May 2021 11:06:33 +0300 Subject: =?UTF-8?q?fixes=20#2884=20(ICQ:=20=D0=B2=D1=80=D0=B5=D0=BC=D1=8F?= =?UTF-8?q?=20=D0=BF=D1=80=D0=BE=D1=87=D1=82=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B1?= =?UTF-8?q?=D0=B5=D0=B7=D0=B1=D0=BE=D0=B6=D0=BD=D0=BE=20=D0=B2=D1=80=D1=91?= =?UTF-8?q?=D1=82)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/MessageState/src/global.h | 8 ++++---- plugins/MessageState/src/messagestate.cpp | 2 +- plugins/MessageState/src/services.cpp | 2 +- plugins/MessageState/src/utils.cpp | 7 ------- 4 files changed, 6 insertions(+), 13 deletions(-) (limited to 'plugins/MessageState') diff --git a/plugins/MessageState/src/global.h b/plugins/MessageState/src/global.h index a689701802..21b12b27dc 100644 --- a/plugins/MessageState/src/global.h +++ b/plugins/MessageState/src/global.h @@ -34,10 +34,10 @@ __forceinline bool CheckProtoSupport(const char *szProto) void InitServices(); -void IconsUpdate(MCONTACT); -void SetSRMMIcon(MCONTACT hContact, int type, time_t time = 0); -__int64 GetPreciousTime(void); -int OnModulesLoaded(WPARAM, LPARAM); bool HasUnread(MCONTACT hContact); +void IconsUpdate(MCONTACT hContact); +void SetSRMMIcon(MCONTACT hContact, int type, time_t time = 0); + +int OnModulesLoaded(WPARAM, LPARAM); #endif //_GLOBAL_H_ \ No newline at end of file diff --git a/plugins/MessageState/src/messagestate.cpp b/plugins/MessageState/src/messagestate.cpp index 99e47ced00..42063a2a00 100644 --- a/plugins/MessageState/src/messagestate.cpp +++ b/plugins/MessageState/src/messagestate.cpp @@ -81,7 +81,7 @@ static int OnEventFilterAdd(WPARAM hContact, LPARAM lParam) { DBEVENTINFO *dbei = (DBEVENTINFO *)lParam; if ((dbei->flags & DBEF_SENT) && CheckProtoSupport(dbei->szModule)) { - __time64_t dwTime = GetPreciousTime(); + time_t dwTime = time(0); FindContact(hContact)->setSent(dwTime); if (db_mc_isSub(hContact)) FindContact(db_mc_getMeta(hContact))->setSent(dwTime); diff --git a/plugins/MessageState/src/services.cpp b/plugins/MessageState/src/services.cpp index 8dc3fa46a3..5487eb448c 100644 --- a/plugins/MessageState/src/services.cpp +++ b/plugins/MessageState/src/services.cpp @@ -13,7 +13,7 @@ static INT_PTR UpdateService(WPARAM hContact, LPARAM lParam) { auto *p = FindContact(hContact); - __time64_t currTime = GetPreciousTime(); + time_t currTime = time(0); if (currTime > p->dwLastReadTime) { p->dwLastReadTime = currTime; p->type = lParam; diff --git a/plugins/MessageState/src/utils.cpp b/plugins/MessageState/src/utils.cpp index 40371be1a5..bd21cc208b 100644 --- a/plugins/MessageState/src/utils.cpp +++ b/plugins/MessageState/src/utils.cpp @@ -26,10 +26,3 @@ bool HasUnread(MCONTACT hContact) return p->dwLastReadTime != 0; } - -__int64 GetPreciousTime() -{ - LARGE_INTEGER li; - QueryPerformanceCounter(&li); - return li.QuadPart; -} -- cgit v1.2.3