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/JabberG/src/jabber_archive.cpp | 4 ++-- protocols/JabberG/src/jabber_iq_handlers.cpp | 5 ++--- protocols/JabberG/src/jabber_notes.cpp | 2 +- protocols/JabberG/src/jabber_proto.cpp | 6 +++--- protocols/JabberG/src/jabber_proto.h | 6 +++--- protocols/JabberG/src/jabber_rc.cpp | 4 ++-- protocols/JabberG/src/jabber_thread.cpp | 2 +- 7 files changed, 14 insertions(+), 15 deletions(-) (limited to 'protocols/JabberG/src') diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp index bba91d3201..91185d924a 100644 --- a/protocols/JabberG/src/jabber_archive.cpp +++ b/protocols/JabberG/src/jabber_archive.cpp @@ -96,12 +96,12 @@ void CJabberProto::OnIqResultGetCollectionList(HXML iqNode, CJabberIqInfo*) static DWORD dwPreviousTimeStamp = -1; static MCONTACT hPreviousContact = INVALID_CONTACT_ID; -static HANDLE hPreviousDbEvent = NULL; +static MEVENT hPreviousDbEvent = NULL; // Returns TRUE if the event already exist in the database BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei) { - HANDLE hExistingDbEvent; + MEVENT hExistingDbEvent; DWORD dwEventTimeStamp; // get last event diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index 4445774672..65b656a594 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -746,12 +746,11 @@ BOOL CJabberProto::AddClistHttpAuthEvent(CJabberHttpAuthParams *pParams) cle.cbSize = sizeof(CLISTEVENT); cle.hIcon = (HICON) LoadIconEx("openid"); cle.flags = CLEF_PROTOCOLGLOBAL | CLEF_TCHAR; - cle.hDbEvent = (HANDLE)("test"); - cle.lParam = (LPARAM) pParams; + cle.hDbEvent = -99; + cle.lParam = (LPARAM)pParams; cle.pszService = szService; cle.ptszTooltip = TranslateT("Http authentication request received"); CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); - return TRUE; } diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index 030c0bbb9f..d39556199e 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -778,7 +778,7 @@ bool CJabberProto::OnIncomingNote(const TCHAR *szFrom, HXML hXml) cle.cbSize = sizeof(CLISTEVENT); cle.hIcon = (HICON)LoadIconEx("notes"); cle.flags = CLEF_PROTOCOLGLOBAL | CLEF_TCHAR; - cle.hDbEvent = (HANDLE)("test"); + cle.hDbEvent = -99; cle.lParam = (LPARAM)pItem; cle.pszService = szService; cle.ptszTooltip = TranslateT("Incoming note"); diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 53530363e4..271c51bed6 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -345,7 +345,7 @@ MCONTACT CJabberProto::AddToList(int flags, PROTOSEARCHRESULT* psr) return AddToListByJID(jid, flags); } -MCONTACT __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, HANDLE hDbEvent) +MCONTACT __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, MEVENT hDbEvent) { debugLogA("AddToListByEvent"); @@ -383,7 +383,7 @@ MCONTACT __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, HAN //////////////////////////////////////////////////////////////////////////////////////// // JabberAuthAllow - processes the successful authorization -int CJabberProto::Authorize(HANDLE hDbEvent) +int CJabberProto::Authorize(MEVENT hDbEvent) { if (!m_bJabberOnline) return 1; @@ -430,7 +430,7 @@ int CJabberProto::Authorize(HANDLE hDbEvent) //////////////////////////////////////////////////////////////////////////////////////// // JabberAuthDeny - handles the unsuccessful authorization -int CJabberProto::AuthDeny(HANDLE hDbEvent, const TCHAR*) +int CJabberProto::AuthDeny(MEVENT hDbEvent, const TCHAR*) { if (!m_bJabberOnline) return 1; diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index c9bbff16c3..96c57806f6 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -83,10 +83,10 @@ struct CJabberProto : public PROTO, public IJabberInterface //==================================================================================== 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); diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp index 5c96401afb..049805bea0 100644 --- a/protocols/JabberG/src/jabber_rc.cpp +++ b/protocols/JabberG/src/jabber_rc.cpp @@ -468,7 +468,7 @@ int CJabberProto::RcGetUnreadEventsCount() ptrT jid( getTStringA(hContact, "jid")); if (jid == NULL) continue; - for (HANDLE hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) { + for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) { DBEVENTINFO dbei = { sizeof(dbei) }; dbei.cbBlob = db_event_getBlobSize(hDbEvent); if (dbei.cbBlob == -1) @@ -555,7 +555,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe if (tszJid == NULL) continue; - for (HANDLE hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) { + for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) { DBEVENTINFO dbei = { sizeof(dbei) }; dbei.cbBlob = db_event_getBlobSize(hDbEvent); if (dbei.cbBlob == -1) diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 99b76a4250..56dec1aa27 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -988,7 +988,7 @@ void CJabberProto::OnProcessPubsubEvent(HXML node) DWORD JabberGetLastContactMessageTime(MCONTACT hContact) { // TODO: time cache can improve performance - HANDLE hDbEvent = db_event_last(hContact); + MEVENT hDbEvent = db_event_last(hContact); if (!hDbEvent) return 0; -- cgit v1.2.3