From 85c0b6a96f366bdf0ca334ee7cb1877fb3f2288c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 16 Jan 2015 17:49:54 +0000 Subject: MEVENT - the strict type for events, they are not HANDLE anymore git-svn-id: http://svn.miranda-ng.org/main/trunk@11866 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/misc.cpp | 70 +++++++++++++++++----------------- protocols/VKontakte/src/vk_feed.cpp | 4 +- protocols/VKontakte/src/vk_history.cpp | 8 ++-- protocols/VKontakte/src/vk_proto.cpp | 6 +-- protocols/VKontakte/src/vk_proto.h | 8 ++-- 5 files changed, 48 insertions(+), 48 deletions(-) (limited to 'protocols/VKontakte/src') diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index c80990c01f..70c28659e5 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -506,23 +506,23 @@ void CVkProto::DBAddAuthRequest(const MCONTACT hContact) mir_free(szNick); } -MCONTACT CVkProto::MContactFromDbEvent(HANDLE hDbEvent) -{ - debugLogA("CVkProto::MContactFromDbEvent"); - if (!hDbEvent || !IsOnline()) - return INVALID_CONTACT_ID; - - DWORD body[2]; - DBEVENTINFO dbei = { sizeof(dbei) }; - dbei.cbBlob = sizeof(DWORD) * 2; - dbei.pBlob = (PBYTE)&body; - - if (db_event_get(hDbEvent, &dbei)) - return INVALID_CONTACT_ID; - if (dbei.eventType != EVENTTYPE_AUTHREQUEST || strcmp(dbei.szModule, m_szModuleName)) - return INVALID_CONTACT_ID; - - MCONTACT hContact = DbGetAuthEventContact(&dbei); +MCONTACT CVkProto::MContactFromDbEvent(MEVENT hDbEvent) +{ + debugLogA("CVkProto::MContactFromDbEvent"); + if (!hDbEvent || !IsOnline()) + return INVALID_CONTACT_ID; + + DWORD body[2]; + DBEVENTINFO dbei = { sizeof(dbei) }; + dbei.cbBlob = sizeof(DWORD) * 2; + dbei.pBlob = (PBYTE)&body; + + if (db_event_get(hDbEvent, &dbei)) + return INVALID_CONTACT_ID; + if (dbei.eventType != EVENTTYPE_AUTHREQUEST || strcmp(dbei.szModule, m_szModuleName)) + return INVALID_CONTACT_ID; + + MCONTACT hContact = DbGetAuthEventContact(&dbei); db_unset(hContact, m_szModuleName, "ReqAuth"); return hContact; } @@ -607,30 +607,30 @@ void CVkProto::ContactTypingThread(void *p) int CVkProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam) { - debugLogA("CVkProto::OnProcessSrmmEvent"); - MessageWindowEventData *event = (MessageWindowEventData *)lParam; - - if (event->uType == MSG_WINDOW_EVT_OPENING) - SetSrmmReadStatus(event->hContact); + debugLogA("CVkProto::OnProcessSrmmEvent"); + MessageWindowEventData *event = (MessageWindowEventData *)lParam; + + if (event->uType == MSG_WINDOW_EVT_OPENING) + SetSrmmReadStatus(event->hContact); return 0; } void CVkProto::SetSrmmReadStatus(MCONTACT hContact) { - time_t time = getDword(hContact, "LastMsgReadTime", 0); - if (!time) - return; - - TCHAR ttime[64]; - _locale_t locale = _create_locale(LC_ALL, ""); - _tcsftime_l(ttime, SIZEOF(ttime), _T("%X - %x"), localtime(&time), locale); - _free_locale(locale); - - StatusTextData st = { 0 }; - st.cbSize = sizeof(st); - st.hIcon = Skin_GetIconByHandle(GetIconHandle(IDI_READMSG)); - mir_sntprintf(st.tszText, SIZEOF(st.tszText), TranslateT("Message read: %s"), ttime); + time_t time = getDword(hContact, "LastMsgReadTime", 0); + if (!time) + return; + + TCHAR ttime[64]; + _locale_t locale = _create_locale(LC_ALL, ""); + _tcsftime_l(ttime, SIZEOF(ttime), _T("%X - %x"), localtime(&time), locale); + _free_locale(locale); + + StatusTextData st = { 0 }; + st.cbSize = sizeof(st); + st.hIcon = Skin_GetIconByHandle(GetIconHandle(IDI_READMSG)); + mir_sntprintf(st.tszText, SIZEOF(st.tszText), TranslateT("Message read: %s"), ttime); CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st); } diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index 1c9daf9df9..4744a9e44b 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -631,9 +631,9 @@ void CVkProto::NewsClearHistory() return; time_t tTime = time(NULL) - m_iNewsAutoClearHistoryInterval; - HANDLE hDBEvent = db_event_first(hContact); + MEVENT hDBEvent = db_event_first(hContact); while (hDBEvent) { - HANDLE hDBEventNext = db_event_next(hContact, hDBEvent); + MEVENT hDBEventNext = db_event_next(hContact, hDBEvent); DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(hDBEvent, &dbei); if (dbei.timestamp < tTime) diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp index f9d3ba4ac2..09715eac04 100644 --- a/protocols/VKontakte/src/vk_history.cpp +++ b/protocols/VKontakte/src/vk_history.cpp @@ -32,9 +32,9 @@ INT_PTR __cdecl CVkProto::SvcGetAllServerHistory(WPARAM hContact, LPARAM) if (userID == -1 || userID == VK_FEED_USER) return 0; - HANDLE hDBEvent = db_event_first(hContact); + MEVENT hDBEvent = db_event_first(hContact); while (hDBEvent) { - HANDLE hDBEventNext = db_event_next(hContact, hDBEvent); + MEVENT hDBEventNext = db_event_next(hContact, hDBEvent); db_event_delete(hContact, hDBEvent); hDBEvent = hDBEventNext; } @@ -102,9 +102,9 @@ void CVkProto::GetServerHistoryLastNDay(MCONTACT hContact, int NDay) time_t tTime = time(NULL) - 60 * 60 * 24 * NDay; - HANDLE hDBEvent = db_event_first(hContact); + MEVENT hDBEvent = db_event_first(hContact); while (hDBEvent) { - HANDLE hDBEventNext = db_event_next(hContact, hDBEvent); + MEVENT hDBEventNext = db_event_next(hContact, hDBEvent); DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(hDBEvent, &dbei); if (dbei.timestamp > tTime) diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index f3881cd76a..e952478e8a 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -677,7 +677,7 @@ void CVkProto::OnReceiveAuthRequest(NETLIBHTTPREQUEST *reply, AsyncHttpRequest * delete param; } -int CVkProto::Authorize(HANDLE hDbEvent) +int CVkProto::Authorize(MEVENT hDbEvent) { debugLogA("CVkProto::Authorize"); if (!IsOnline()) @@ -689,7 +689,7 @@ int CVkProto::Authorize(HANDLE hDbEvent) return AuthRequest(hContact, NULL); } -int CVkProto::AuthDeny(HANDLE hDbEvent, const PROTOCHAR*) +int CVkProto::AuthDeny(MEVENT hDbEvent, const PROTOCHAR*) { debugLogA("CVkProto::AuthDeny"); if (!IsOnline()) @@ -721,7 +721,7 @@ int CVkProto::UserIsTyping(MCONTACT hContact, int type) return 1; } -MCONTACT CVkProto::AddToListByEvent(int, int, HANDLE) +MCONTACT CVkProto::AddToListByEvent(int, int, MEVENT) { return NULL; } diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index 1e29b642b7..c77952393e 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -250,10 +250,10 @@ struct CVkProto : public PROTO //==================================================================================== virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); - virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, HANDLE hDbEvent); + virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent); - virtual int __cdecl Authorize(HANDLE hDbEvent); - virtual int __cdecl AuthDeny(HANDLE hDbEvent, const TCHAR *szReason); + virtual int __cdecl Authorize(MEVENT hDbEvent); + virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR *szReason); virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*); virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR *szMessage); @@ -403,7 +403,7 @@ struct CVkProto : public PROTO void ApplyCookies(AsyncHttpRequest*); void DBAddAuthRequest(const MCONTACT hContact); - MCONTACT MContactFromDbEvent(HANDLE hDbEvent); + MCONTACT MContactFromDbEvent(MEVENT hDbEvent); void SetMirVer(MCONTACT hContact, int platform); -- cgit v1.2.3