diff options
author | George Hazan <george.hazan@gmail.com> | 2015-01-16 17:49:54 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-01-16 17:49:54 +0000 |
commit | 85c0b6a96f366bdf0ca334ee7cb1877fb3f2288c (patch) | |
tree | fe07935255b7432938f282419c3ab1378524c02f /plugins | |
parent | 8a09c895c4cd0e9cc87c38181ae2913dba77c30b (diff) |
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
Diffstat (limited to 'plugins')
105 files changed, 303 insertions, 329 deletions
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index 0c8a22397e..bce511ce8f 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -89,10 +89,8 @@ static TCHAR* GetMessageText(BYTE **ppBlob,DWORD *pcbBlob) return (WCHAR*)buf;
}
-static int MsgEventAdded(WPARAM wParam,LPARAM lParam)
+static int MsgEventAdded(WPARAM wParam,LPARAM hDbEvent)
{
- HANDLE hDbEvent = (HANDLE)lParam;
-
if (currentWatcherType & SDWTF_MESSAGE) {
DBEVENTINFO dbe = { sizeof(dbe) };
dbe.cbBlob = db_event_getBlobSize(hDbEvent);
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index 64ac70749d..5746cd3053 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -60,7 +60,7 @@ public: mir_free(filelink);
}
- HANDLE hDbEvent;
+ MEVENT hDbEvent;
TCHAR *filename;
TCHAR *filelink;
};
@@ -434,7 +434,7 @@ int FillAvatarListFromDB(HWND list, MCONTACT hContact) {
int max_pos = 0;
BYTE blob[2048];
- for (HANDLE hDbEvent = db_event_first(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
+ for (MEVENT hDbEvent = db_event_first(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.cbBlob = sizeof(blob);
dbei.pBlob = blob;
diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index a70772e3d9..aadf2a73a4 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -198,7 +198,7 @@ void EventList::GetTempList(std::list<EventTempIndex>& tempList, bool noFilter, EventIndex ei;
ti.isExternal = false;
ei.isExternal = false;
- HANDLE hDbEvent = db_event_first(_hContact);
+ MEVENT hDbEvent = db_event_first(_hContact);
while (hDbEvent != NULL) {
if (isWndLocal && !IsWindow(hWnd))
break;
diff --git a/plugins/BasicHistory/src/EventList.h b/plugins/BasicHistory/src/EventList.h index a4f5dd885d..3b037b0a5a 100644 --- a/plugins/BasicHistory/src/EventList.h +++ b/plugins/BasicHistory/src/EventList.h @@ -40,7 +40,7 @@ public: {
union
{
- HANDLE hEvent;
+ MEVENT hEvent;
int exIdx;
};
bool isExternal;
@@ -59,7 +59,7 @@ private: {
union
{
- HANDLE hEvent;
+ MEVENT hEvent;
int exIdx;
};
bool isExternal;
diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp index 76b5bd3c9a..74fe25d110 100644 --- a/plugins/BasicHistory/src/HistoryWindow.cpp +++ b/plugins/BasicHistory/src/HistoryWindow.cpp @@ -475,9 +475,9 @@ INT_PTR HistoryWindow::DeleteAllUserHistory(WPARAM hContact, LPARAM) return FALSE;
CallService(MS_DB_SETSAFETYMODE, FALSE, 0);
- HANDLE hDbEvent = db_event_last(hContact);
+ MEVENT hDbEvent = db_event_last(hContact);
while (hDbEvent != NULL) {
- HANDLE hPrevEvent = db_event_prev(hContact, hDbEvent);
+ MEVENT hPrevEvent = db_event_prev(hContact, hDbEvent);
hDbEvent = ( db_event_delete(hContact, hDbEvent) == 0) ? hPrevEvent : NULL;
}
CallService(MS_DB_SETSAFETYMODE, TRUE, 0);
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index c4444fe221..defc925837 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -210,7 +210,7 @@ static bool BoltunAutoChat(MCONTACT hContact) return false;
}
-static int MessageEventAdded(WPARAM hContact, LPARAM lParam)
+static int MessageEventAdded(WPARAM hContact, LPARAM hDbEvent)
{
if (!BoltunAutoChat(hContact))
return 0;
@@ -219,8 +219,6 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) memset(&dbei, 0, sizeof(dbei));
dbei.cbSize = sizeof(dbei);
dbei.cbBlob = 0;
-
- HANDLE hDbEvent = (HANDLE)lParam;
dbei.cbBlob = db_event_getBlobSize(hDbEvent);
if (dbei.cbBlob == -1)
return 0;
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index ded191b288..9f5a9eac05 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -81,7 +81,7 @@ void setLastSeen(MCONTACT hContact) time_t getLastInputMsg(MCONTACT hContact)
{
- HANDLE hDbEvent = db_event_last(hContact);
+ MEVENT hDbEvent = db_event_last(hContact);
while (hDbEvent) {
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h index cfb30d7069..f92b95bb30 100644 --- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h @@ -266,7 +266,7 @@ int cliFindRowByText(HWND hwnd, ClcData *dat, const TCHAR *text, int prefixO int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex);
int cli_IconFromStatusMode(const char *szProto, int nStatus, MCONTACT hContact);
int cli_GetContactIcon(MCONTACT hContact);
-int cli_RemoveEvent(MCONTACT hContact, HANDLE hDbEvent);
+int cli_RemoveEvent(MCONTACT hContact, MEVENT hDbEvent);
void cli_AddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTotalCount, int checkHideOffline);
void cli_DeleteItemFromTree(HWND hwnd, MCONTACT hItem);
void cli_FreeContact(ClcContact*);
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 43ab091a44..5d03e2e199 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -247,7 +247,7 @@ static int clcHookDbEventAdded(WPARAM hContact, LPARAM lParam) g_CluiData.t_now = time(NULL); if (hContact && lParam) { DBEVENTINFO dbei = { sizeof(dbei) }; - db_event_get((HANDLE)lParam, &dbei); + db_event_get(lParam, &dbei); if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) { db_set_dw(hContact, "CList", "mf_lastmsg", dbei.timestamp); ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry(hContact); diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index a3976c01fd..85a278a7ad 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -78,7 +78,7 @@ struct NotifyMenuItemExData { MCONTACT hContact;
int iIcon; // icon index in the image list
HICON hIcon; // corresponding icon handle
- HANDLE hDbEvent;
+ MEVENT hDbEvent;
};
static CLISTEVENT* MyGetEvent(int iSelection)
@@ -106,7 +106,7 @@ struct CListEvent* cli_AddEvent(CLISTEVENT *cle) if (p == NULL)
return NULL;
- if (p->cle.hContact != 0 && p->cle.hDbEvent != (HANDLE)1 && !(p->cle.flags & CLEF_ONLYAFEW)) {
+ if (p->cle.hContact != 0 && p->cle.hDbEvent != 1 && !(p->cle.flags & CLEF_ONLYAFEW)) {
MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_DATA | MIIM_BITMAP | MIIM_ID;
if (p->cle.pszService &&
@@ -170,7 +170,7 @@ struct CListEvent* cli_AddEvent(CLISTEVENT *cle) }
-int cli_RemoveEvent(MCONTACT hContact, HANDLE hDbEvent)
+int cli_RemoveEvent(MCONTACT hContact, MEVENT hDbEvent)
{
// Find the event that should be removed
int i;
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp index e7f9bf90eb..383500629d 100644 --- a/plugins/Clist_modern/src/modern_contact.cpp +++ b/plugins/Clist_modern/src/modern_contact.cpp @@ -65,7 +65,7 @@ static int GetStatusModeOrdering(int statusMode) DWORD CompareContacts2_getLMTime(MCONTACT hContact)
{
- HANDLE hDbEvent = db_event_last(hContact);
+ MEVENT hDbEvent = db_event_last(hContact);
while (hDbEvent) {
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
diff --git a/plugins/Clist_nicer/src/Include/clc.h b/plugins/Clist_nicer/src/Include/clc.h index b9911140ff..5e93ec0b54 100644 --- a/plugins/Clist_nicer/src/Include/clc.h +++ b/plugins/Clist_nicer/src/Include/clc.h @@ -333,7 +333,7 @@ struct NotifyMenuItemExData MCONTACT hContact;
int iIcon; // icon index in the image list
HICON hIcon; // corresponding icon handle
- HANDLE hDbEvent;
+ MEVENT hDbEvent;
};
// #define NOTIFY_HEIGHT 24
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 61c12e4dd5..db8eda857b 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -76,7 +76,7 @@ static int ClcEventAdded(WPARAM hContact, LPARAM lParam) if (hContact && lParam) {
DBEVENTINFO dbei = { sizeof(dbei) };
- db_event_get((HANDLE)lParam, &dbei);
+ db_event_get(lParam, &dbei);
if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) {
DWORD firstTime = cfg::getDword(hContact, "CList", "mf_firstEvent", 0);
DWORD count = cfg::getDword(hContact, "CList", "mf_count", 0);
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp index b4c710ce06..16c1735c73 100644 --- a/plugins/Clist_nicer/src/clistevents.cpp +++ b/plugins/Clist_nicer/src/clistevents.cpp @@ -257,7 +257,7 @@ CListEvent* AddEvent(CLISTEVENT *cle) if (p == NULL)
return NULL;
- if (p->cle.hContact != 0 && p->cle.hDbEvent != (HANDLE)1 && !(p->cle.flags & CLEF_ONLYAFEW)) {
+ if (p->cle.hContact != 0 && p->cle.hDbEvent != 1 && !(p->cle.flags & CLEF_ONLYAFEW)) {
MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_DATA | MIIM_BITMAP | MIIM_ID;
if (p->cle.pszService && !strncmp("SRMsg/ReadMessage", p->cle.pszService, 17)) {
@@ -329,7 +329,7 @@ CListEvent* AddEvent(CLISTEVENT *cle) // wParam=(MCONTACT)hContact
// lParam=(LPARAM)(HANDLE)hDbEvent
// Returns 0 if the event was successfully removed, or nonzero if the event was not found
-int RemoveEvent(MCONTACT hContact, HANDLE hDbEvent)
+int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent)
{
// Find the event that should be removed
int i;
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index bf9d9ade7b..bf060534fd 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -66,7 +66,7 @@ static void MF_CalcFrequency(MCONTACT hContact, DWORD dwCutoffDays, int doSleep) {
DWORD curTime = time(NULL);
DWORD frequency, eventCount;
- HANDLE hEvent = db_event_last(hContact);
+ MEVENT hEvent = db_event_last(hContact);
eventCount = 0;
@@ -151,7 +151,7 @@ void LoadContactTree(void) DWORD INTSORT_GetLastMsgTime(MCONTACT hContact)
{
- for (HANDLE hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) {
+ for (MEVENT hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) {
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT))
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index ec724c0246..a9eef79489 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -60,7 +60,7 @@ ClcGroup *AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD fl int AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact);
int AddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText);
LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
-int RemoveEvent(MCONTACT hContact, HANDLE hDbEvent);
+int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent);
INT_PTR TrayIconProcessMessage(WPARAM wParam, LPARAM lParam);
void RecalcScrollBar(HWND hwnd, struct ClcData *dat);
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 4c075cd84a..7f0c75260f 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -1518,7 +1518,7 @@ void HandleContactsCommand(PCommand command, TArgument *argv, int argc, PReply r *reply->message = 0;
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- HANDLE hUnreadEvent = db_event_firstUnread(hContact);
+ MEVENT hUnreadEvent = db_event_firstUnread(hContact);
if (hUnreadEvent != NULL) {
DWORD threadID;
HANDLE thread = CreateThread(NULL, NULL, OpenMessageWindowThread, (void*)hContact, NULL, &threadID);
@@ -1587,7 +1587,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re mir_snprintf(reply->message, reply->cMessage, Translate("No unread messages found."));
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- HANDLE hEvent = db_event_firstUnread(hContact);
+ MEVENT hEvent = db_event_firstUnread(hContact);
if (hEvent != NULL) {
count = 0;
while (hEvent != NULL) {
@@ -1631,7 +1631,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re {
if (_stricmp(cmd, "unread") == 0)
{
- HANDLE hEvent = db_event_firstUnread(hContact);
+ MEVENT hEvent = db_event_firstUnread(hContact);
reply->code = MIMRES_SUCCESS;
@@ -1683,7 +1683,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re if (count > 0)
{
int index = 0;
- HANDLE hEvent = db_event_first(hContact);
+ MEVENT hEvent = db_event_first(hContact);
DBEVENTINFO dbEvent = { sizeof(DBEVENTINFO) };
char message[4096];
dbEvent.pBlob = (PBYTE) message;
@@ -1691,7 +1691,7 @@ void HandleHistoryCommand(PCommand command, TArgument *argv, int argc, PReply re while (hEvent)
{
dbEvent.cbBlob = sizeof(message);
- if (!db_event_get( hEvent, &dbEvent)) // if successful call
+ if (!db_event_get(hEvent, &dbEvent)) // if successful call
{
dbEvent.pBlob[dbEvent.cbBlob] = 0;
if ((index >= start) && (index <= stop))
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index d8cd064f55..a34c8ed315 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -57,9 +57,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE;
}
-static int HookDBEventAdded(WPARAM hContact, LPARAM lParam)
+static int HookDBEventAdded(WPARAM hContact, LPARAM hDbEvent)
{
- HANDLE hDbEvent = (HANDLE)lParam;
//process the event
DBEVENTINFO dbe = { sizeof(dbe) };
db_event_get(hDbEvent, &dbe);
@@ -92,7 +91,7 @@ static int HookDBEventAdded(WPARAM hContact, LPARAM lParam) static void ProcessUnreadEvents(void)
{
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- 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) };
db_event_get(hDbEvent, &dbei);
if (!(dbei.flags & (DBEF_SENT | DBEF_READ)) && dbei.eventType == EVENTTYPE_CONTACTS) {
diff --git a/plugins/ContactsPlus/src/receive.h b/plugins/ContactsPlus/src/receive.h index 3f67906930..73ee03cb1e 100644 --- a/plugins/ContactsPlus/src/receive.h +++ b/plugins/ContactsPlus/src/receive.h @@ -46,7 +46,7 @@ struct TRecvContactsData TRecvContactsData(MCONTACT contact);
~TRecvContactsData();
- HANDLE mhDbEvent; // handle to recv DB event
+ MEVENT mhDbEvent; // handle to recv DB event
MCONTACT mhContact; // from whom we received this
HIMAGELIST mhListIcon;// icons for listview
HMENU mhPopup; // popup menu for listview
diff --git a/plugins/Db3x_mmap/src/dbevents.cpp b/plugins/Db3x_mmap/src/dbevents.cpp index 4806e0140c..a869a6a949 100644 --- a/plugins/Db3x_mmap/src/dbevents.cpp +++ b/plugins/Db3x_mmap/src/dbevents.cpp @@ -32,7 +32,7 @@ STDMETHODIMP_(LONG) CDb3Mmap::GetEventCount(MCONTACT contactID) return (dbc->signature != DBCONTACT_SIGNATURE) ? -1 : dbc->eventCount;
}
-STDMETHODIMP_(HANDLE) CDb3Mmap::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei)
+STDMETHODIMP_(MEVENT) CDb3Mmap::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei)
{
if (dbei == NULL || dbei->cbSize != sizeof(DBEVENTINFO)) return 0;
if (dbei->timestamp == 0) return 0;
@@ -160,10 +160,10 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei) if (neednotify)
NotifyEventHooks(hEventAddedEvent, contactNotifyID, (LPARAM)ofsNew);
- return (HANDLE)ofsNew;
+ return (MEVENT)ofsNew;
}
-STDMETHODIMP_(BOOL) CDb3Mmap::DeleteEvent(MCONTACT contactID, HANDLE hDbEvent)
+STDMETHODIMP_(BOOL) CDb3Mmap::DeleteEvent(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc;
if (contactID) {
@@ -258,14 +258,14 @@ STDMETHODIMP_(BOOL) CDb3Mmap::DeleteEvent(MCONTACT contactID, HANDLE hDbEvent) return 0;
}
-STDMETHODIMP_(LONG) CDb3Mmap::GetBlobSize(HANDLE hDbEvent)
+STDMETHODIMP_(LONG) CDb3Mmap::GetBlobSize(MEVENT hDbEvent)
{
mir_cslock lck(m_csDbAccess);
DBEvent *dbe = AdaptEvent((DWORD)hDbEvent, 0);
return (dbe->signature != DBEVENT_SIGNATURE) ? -1 : dbe->cbBlob;
}
-STDMETHODIMP_(BOOL) CDb3Mmap::GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbei)
+STDMETHODIMP_(BOOL) CDb3Mmap::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei)
{
if (dbei == NULL || dbei->cbSize != sizeof(DBEVENTINFO)) return 1;
if (dbei->cbBlob > 0 && dbei->pBlob == NULL) {
@@ -307,7 +307,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbei) return 0;
}
-STDMETHODIMP_(BOOL) CDb3Mmap::MarkEventRead(MCONTACT contactID, HANDLE hDbEvent)
+STDMETHODIMP_(BOOL) CDb3Mmap::MarkEventRead(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc;
if (contactID) {
@@ -357,14 +357,14 @@ STDMETHODIMP_(BOOL) CDb3Mmap::MarkEventRead(MCONTACT contactID, HANDLE hDbEvent) return ret;
}
-STDMETHODIMP_(MCONTACT) CDb3Mmap::GetEventContact(HANDLE hDbEvent)
+STDMETHODIMP_(MCONTACT) CDb3Mmap::GetEventContact(MEVENT hDbEvent)
{
mir_cslock lck(m_csDbAccess);
DBEvent *dbe = AdaptEvent((DWORD)hDbEvent, INVALID_CONTACT_ID);
return (dbe->signature != DBEVENT_SIGNATURE) ? INVALID_CONTACT_ID : dbe->contactID;
}
-STDMETHODIMP_(HANDLE) CDb3Mmap::FindFirstEvent(MCONTACT contactID)
+STDMETHODIMP_(MEVENT) CDb3Mmap::FindFirstEvent(MCONTACT contactID)
{
DBCachedContact *cc;
DWORD ofsContact = GetContactOffset(contactID, &cc);
@@ -374,7 +374,7 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::FindFirstEvent(MCONTACT contactID) if (dbc->signature != DBCONTACT_SIGNATURE)
return NULL;
if (!cc || !cc->IsSub())
- return HANDLE(dbc->ofsFirstEvent);
+ return MEVENT(dbc->ofsFirstEvent);
if ((cc = m_cache->GetCachedContact(cc->parentID)) == NULL)
return NULL;
@@ -387,13 +387,13 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::FindFirstEvent(MCONTACT contactID) if (dbe->signature != DBEVENT_SIGNATURE)
return NULL;
if (dbe->contactID == contactID)
- return HANDLE(dwOffset);
+ return MEVENT(dwOffset);
dwOffset = dbe->ofsNext;
}
return NULL;
}
-STDMETHODIMP_(HANDLE) CDb3Mmap::FindFirstUnreadEvent(MCONTACT contactID)
+STDMETHODIMP_(MEVENT) CDb3Mmap::FindFirstUnreadEvent(MCONTACT contactID)
{
DBCachedContact *cc;
DWORD ofsContact = GetContactOffset(contactID, &cc);
@@ -403,7 +403,7 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::FindFirstUnreadEvent(MCONTACT contactID) if (dbc->signature != DBCONTACT_SIGNATURE)
return NULL;
if (!cc || !cc->IsSub())
- return HANDLE(dbc->ofsFirstUnread);
+ return MEVENT(dbc->ofsFirstUnread);
if ((cc = m_cache->GetCachedContact(cc->parentID)) == NULL)
return NULL;
@@ -416,13 +416,13 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::FindFirstUnreadEvent(MCONTACT contactID) if (dbe->signature != DBEVENT_SIGNATURE)
return NULL;
if (dbe->contactID == contactID && !dbe->markedRead())
- return HANDLE(dwOffset);
+ return MEVENT(dwOffset);
dwOffset = dbe->ofsNext;
}
return NULL;
}
-STDMETHODIMP_(HANDLE) CDb3Mmap::FindLastEvent(MCONTACT contactID)
+STDMETHODIMP_(MEVENT) CDb3Mmap::FindLastEvent(MCONTACT contactID)
{
DBCachedContact *cc;
DWORD ofsContact = GetContactOffset(contactID, &cc);
@@ -432,7 +432,7 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::FindLastEvent(MCONTACT contactID) if (dbc->signature != DBCONTACT_SIGNATURE)
return NULL;
if (!cc || !cc->IsSub())
- return HANDLE(dbc->ofsLastEvent);
+ return MEVENT(dbc->ofsLastEvent);
if ((cc = m_cache->GetCachedContact(cc->parentID)) == NULL)
return NULL;
@@ -445,13 +445,13 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::FindLastEvent(MCONTACT contactID) if (dbe->signature != DBEVENT_SIGNATURE)
return NULL;
if (dbe->contactID == contactID)
- return HANDLE(dwOffset);
+ return MEVENT(dwOffset);
dwOffset = dbe->ofsPrev;
}
return NULL;
}
-STDMETHODIMP_(HANDLE) CDb3Mmap::FindNextEvent(MCONTACT contactID, HANDLE hDbEvent)
+STDMETHODIMP_(MEVENT) CDb3Mmap::FindNextEvent(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc = (contactID) ? m_cache->GetCachedContact(contactID) : NULL;
@@ -460,20 +460,20 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::FindNextEvent(MCONTACT contactID, HANDLE hDbEven if (dbe->signature != DBEVENT_SIGNATURE)
return NULL;
if (!cc || !cc->IsSub())
- return HANDLE(dbe->ofsNext);
+ return MEVENT(dbe->ofsNext);
for (DWORD dwOffset = dbe->ofsNext; dwOffset != 0;) {
dbe = AdaptEvent(dwOffset, contactID);
if (dbe->signature != DBEVENT_SIGNATURE)
return NULL;
if (dbe->contactID == contactID)
- return HANDLE(dwOffset);
+ return MEVENT(dwOffset);
dwOffset = dbe->ofsNext;
}
return NULL;
}
-STDMETHODIMP_(HANDLE) CDb3Mmap::FindPrevEvent(MCONTACT contactID, HANDLE hDbEvent)
+STDMETHODIMP_(MEVENT) CDb3Mmap::FindPrevEvent(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc = (contactID) ? m_cache->GetCachedContact(contactID) : NULL;
@@ -482,14 +482,14 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::FindPrevEvent(MCONTACT contactID, HANDLE hDbEven if (dbe->signature != DBEVENT_SIGNATURE)
return NULL;
if (!cc || !cc->IsSub())
- return HANDLE(dbe->ofsPrev);
+ return MEVENT(dbe->ofsPrev);
for (DWORD dwOffset = dbe->ofsPrev; dwOffset != 0;) {
dbe = AdaptEvent(dwOffset, contactID);
if (dbe->signature != DBEVENT_SIGNATURE)
return NULL;
if (dbe->contactID == contactID)
- return HANDLE(dwOffset);
+ return MEVENT(dwOffset);
dwOffset = dbe->ofsPrev;
}
return NULL;
diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h index c6e34b68d6..df3d1cd949 100644 --- a/plugins/Db3x_mmap/src/dbintf.h +++ b/plugins/Db3x_mmap/src/dbintf.h @@ -211,17 +211,17 @@ public: STDMETHODIMP_(BOOL) IsDbContact(MCONTACT contactID);
STDMETHODIMP_(LONG) GetEventCount(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe);
- STDMETHODIMP_(BOOL) DeleteEvent(MCONTACT contactID, HANDLE hDbEvent);
- STDMETHODIMP_(LONG) GetBlobSize(HANDLE hDbEvent);
- STDMETHODIMP_(BOOL) GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbe);
- STDMETHODIMP_(BOOL) MarkEventRead(MCONTACT contactID, HANDLE hDbEvent);
- STDMETHODIMP_(MCONTACT) GetEventContact(HANDLE hDbEvent);
- STDMETHODIMP_(HANDLE) FindFirstEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindFirstUnreadEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindLastEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindNextEvent(MCONTACT contactID, HANDLE hDbEvent);
- STDMETHODIMP_(HANDLE) FindPrevEvent(MCONTACT contactID, HANDLE hDbEvent);
+ STDMETHODIMP_(MEVENT) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe);
+ STDMETHODIMP_(BOOL) DeleteEvent(MCONTACT contactID, MEVENT hDbEvent);
+ STDMETHODIMP_(LONG) GetBlobSize(MEVENT hDbEvent);
+ STDMETHODIMP_(BOOL) GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbe);
+ STDMETHODIMP_(BOOL) MarkEventRead(MCONTACT contactID, MEVENT hDbEvent);
+ STDMETHODIMP_(MCONTACT) GetEventContact(MEVENT hDbEvent);
+ STDMETHODIMP_(MEVENT) FindFirstEvent(MCONTACT contactID);
+ STDMETHODIMP_(MEVENT) FindFirstUnreadEvent(MCONTACT contactID);
+ STDMETHODIMP_(MEVENT) FindLastEvent(MCONTACT contactID);
+ STDMETHODIMP_(MEVENT) FindNextEvent(MCONTACT contactID, MEVENT hDbEvent);
+ STDMETHODIMP_(MEVENT) FindPrevEvent(MCONTACT contactID, MEVENT hDbEvent);
STDMETHODIMP_(BOOL) EnumModuleNames(DBMODULEENUMPROC pFunc, void *pParam);
diff --git a/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj b/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj index 524802fcdc..6a75d66c96 100644 --- a/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj +++ b/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj @@ -223,6 +223,8 @@ <ClCompile Include="src\ui.cpp" />
</ItemGroup>
<ItemGroup>
+ <ClInclude Include="..\..\include\m_database.h" />
+ <ClInclude Include="..\..\include\m_db_int.h" />
<ClInclude Include="src\commonheaders.h" />
<ClInclude Include="src\dbintf.h" />
<ClInclude Include="src\lmdb\lmdb.h" />
diff --git a/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj.filters b/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj.filters index 4b988cea86..0ec4253319 100644 --- a/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj.filters +++ b/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj.filters @@ -71,6 +71,12 @@ <ClInclude Include="src\lmdb\midl.h">
<Filter>Source Files\lmdb</Filter>
</ClInclude>
+ <ClInclude Include="..\..\include\m_database.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\include\m_db_int.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\dbx_mdb.rc">
diff --git a/plugins/Dbx_mdb/src/dbevents.cpp b/plugins/Dbx_mdb/src/dbevents.cpp index 6b7085575c..949c6eab64 100644 --- a/plugins/Dbx_mdb/src/dbevents.cpp +++ b/plugins/Dbx_mdb/src/dbevents.cpp @@ -31,7 +31,7 @@ STDMETHODIMP_(LONG) CDbxMdb::GetEventCount(MCONTACT contactID) return -1;
}
-STDMETHODIMP_(HANDLE) CDbxMdb::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei)
+STDMETHODIMP_(MEVENT) CDbxMdb::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei)
{
if (dbei == NULL || dbei->cbSize != sizeof(DBEVENTINFO)) return 0;
if (dbei->timestamp == 0) return 0;
@@ -84,10 +84,10 @@ STDMETHODIMP_(HANDLE) CDbxMdb::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei) // Notify only in safe mode or on really new events
NotifyEventHooks(hEventAddedEvent, contactNotifyID, (LPARAM)-1);
- return (HANDLE)0;
+ return (MEVENT)0;
}
-STDMETHODIMP_(BOOL) CDbxMdb::DeleteEvent(MCONTACT contactID, HANDLE hDbEvent)
+STDMETHODIMP_(BOOL) CDbxMdb::DeleteEvent(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc;
if (contactID) {
@@ -110,13 +110,13 @@ STDMETHODIMP_(BOOL) CDbxMdb::DeleteEvent(MCONTACT contactID, HANDLE hDbEvent) return 0;
}
-STDMETHODIMP_(LONG) CDbxMdb::GetBlobSize(HANDLE hDbEvent)
+STDMETHODIMP_(LONG) CDbxMdb::GetBlobSize(MEVENT hDbEvent)
{
mir_cslock lck(m_csDbAccess);
return -1;
}
-STDMETHODIMP_(BOOL) CDbxMdb::GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbei)
+STDMETHODIMP_(BOOL) CDbxMdb::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei)
{
if (dbei == NULL || dbei->cbSize != sizeof(DBEVENTINFO)) return 1;
if (dbei->cbBlob > 0 && dbei->pBlob == NULL) {
@@ -128,7 +128,7 @@ STDMETHODIMP_(BOOL) CDbxMdb::GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbei) return 0;
}
-STDMETHODIMP_(BOOL) CDbxMdb::MarkEventRead(MCONTACT contactID, HANDLE hDbEvent)
+STDMETHODIMP_(BOOL) CDbxMdb::MarkEventRead(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc;
if (contactID) {
@@ -147,31 +147,31 @@ STDMETHODIMP_(BOOL) CDbxMdb::MarkEventRead(MCONTACT contactID, HANDLE hDbEvent) return -11;
}
-STDMETHODIMP_(MCONTACT) CDbxMdb::GetEventContact(HANDLE hDbEvent)
+STDMETHODIMP_(MCONTACT) CDbxMdb::GetEventContact(MEVENT hDbEvent)
{
mir_cslock lck(m_csDbAccess);
return INVALID_CONTACT_ID;
}
-STDMETHODIMP_(HANDLE) CDbxMdb::FindFirstEvent(MCONTACT contactID)
+STDMETHODIMP_(MEVENT) CDbxMdb::FindFirstEvent(MCONTACT contactID)
{
mir_cslock lck(m_csDbAccess);
return NULL;
}
-STDMETHODIMP_(HANDLE) CDbxMdb::FindFirstUnreadEvent(MCONTACT contactID)
+STDMETHODIMP_(MEVENT) CDbxMdb::FindFirstUnreadEvent(MCONTACT contactID)
{
mir_cslock lck(m_csDbAccess);
return NULL;
}
-STDMETHODIMP_(HANDLE) CDbxMdb::FindLastEvent(MCONTACT contactID)
+STDMETHODIMP_(MEVENT) CDbxMdb::FindLastEvent(MCONTACT contactID)
{
mir_cslock lck(m_csDbAccess);
return NULL;
}
-STDMETHODIMP_(HANDLE) CDbxMdb::FindNextEvent(MCONTACT contactID, HANDLE hDbEvent)
+STDMETHODIMP_(MEVENT) CDbxMdb::FindNextEvent(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc = (contactID) ? m_cache->GetCachedContact(contactID) : NULL;
@@ -179,7 +179,7 @@ STDMETHODIMP_(HANDLE) CDbxMdb::FindNextEvent(MCONTACT contactID, HANDLE hDbEvent return NULL;
}
-STDMETHODIMP_(HANDLE) CDbxMdb::FindPrevEvent(MCONTACT contactID, HANDLE hDbEvent)
+STDMETHODIMP_(MEVENT) CDbxMdb::FindPrevEvent(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc = (contactID) ? m_cache->GetCachedContact(contactID) : NULL;
diff --git a/plugins/Dbx_mdb/src/dbintf.cpp b/plugins/Dbx_mdb/src/dbintf.cpp index 48f7deb1db..f519d3dd4b 100644 --- a/plugins/Dbx_mdb/src/dbintf.cpp +++ b/plugins/Dbx_mdb/src/dbintf.cpp @@ -93,6 +93,7 @@ int CDbxMdb::Load(bool bSkipInit) mdb_open(trnlck, "contacts", MDB_CREATE | MDB_INTEGERKEY, &m_dbContacts);
mdb_open(trnlck, "modules", MDB_CREATE | MDB_INTEGERKEY, &m_dbModules);
mdb_open(trnlck, "events", MDB_CREATE | MDB_INTEGERKEY, &m_dbEvents);
+ mdb_open(trnlck, "eventsrt", MDB_CREATE, &m_dbEvents);
mdb_open(trnlck, "settings", MDB_CREATE, &m_dbSettings);
trnlck.commit();
diff --git a/plugins/Dbx_mdb/src/dbintf.h b/plugins/Dbx_mdb/src/dbintf.h index e83f559634..26f7c29629 100644 --- a/plugins/Dbx_mdb/src/dbintf.h +++ b/plugins/Dbx_mdb/src/dbintf.h @@ -156,17 +156,17 @@ public: STDMETHODIMP_(BOOL) IsDbContact(MCONTACT contactID);
STDMETHODIMP_(LONG) GetEventCount(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe);
- STDMETHODIMP_(BOOL) DeleteEvent(MCONTACT contactID, HANDLE hDbEvent);
- STDMETHODIMP_(LONG) GetBlobSize(HANDLE hDbEvent);
- STDMETHODIMP_(BOOL) GetEvent(HANDLE hDbEvent, DBEVENTINFO *dbe);
- STDMETHODIMP_(BOOL) MarkEventRead(MCONTACT contactID, HANDLE hDbEvent);
- STDMETHODIMP_(MCONTACT) GetEventContact(HANDLE hDbEvent);
- STDMETHODIMP_(HANDLE) FindFirstEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindFirstUnreadEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindLastEvent(MCONTACT contactID);
- STDMETHODIMP_(HANDLE) FindNextEvent(MCONTACT contactID, HANDLE hDbEvent);
- STDMETHODIMP_(HANDLE) FindPrevEvent(MCONTACT contactID, HANDLE hDbEvent);
+ STDMETHODIMP_(MEVENT) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe);
+ STDMETHODIMP_(BOOL) DeleteEvent(MCONTACT contactID, MEVENT hDbEvent);
+ STDMETHODIMP_(LONG) GetBlobSize(MEVENT hDbEvent);
+ STDMETHODIMP_(BOOL) GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbe);
+ STDMETHODIMP_(BOOL) MarkEventRead(MCONTACT contactID, MEVENT hDbEvent);
+ STDMETHODIMP_(MCONTACT) GetEventContact(MEVENT hDbEvent);
+ STDMETHODIMP_(MEVENT) FindFirstEvent(MCONTACT contactID);
+ STDMETHODIMP_(MEVENT) FindFirstUnreadEvent(MCONTACT contactID);
+ STDMETHODIMP_(MEVENT) FindLastEvent(MCONTACT contactID);
+ STDMETHODIMP_(MEVENT) FindNextEvent(MCONTACT contactID, MEVENT hDbEvent);
+ STDMETHODIMP_(MEVENT) FindPrevEvent(MCONTACT contactID, MEVENT hDbEvent);
STDMETHODIMP_(BOOL) EnumModuleNames(DBMODULEENUMPROC pFunc, void *pParam);
diff --git a/plugins/ExternalAPI/m_ieview.h b/plugins/ExternalAPI/m_ieview.h index 08277c92e0..85c2b7276c 100644 --- a/plugins/ExternalAPI/m_ieview.h +++ b/plugins/ExternalAPI/m_ieview.h @@ -167,7 +167,7 @@ typedef struct { HWND hwnd; // HWND returned by IEW_CREATE
MCONTACT hContact; // contact
union {
- HANDLE hDbEventFirst; // first event to log, when IEE_LOG_EVENTS returns it will contain
+ MEVENT hDbEventFirst; // first event to log, when IEE_LOG_EVENTS returns it will contain
// the last event actually logged or NULL if no event was logged (IEE_LOG_EVENTS)
IEVIEWEVENTDATA *eventData; // the pointer to an array of IEVIEWEVENTDATA objects (IEE_LOG_IEV_EVENTS)
};
diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp index 48cfe368a0..a72a24e8c8 100644 --- a/plugins/FavContacts/src/contact_cache.cpp +++ b/plugins/FavContacts/src/contact_cache.cpp @@ -27,10 +27,8 @@ CContactCache::~CContactCache() DeleteCriticalSection(&m_cs);
}
-int __cdecl CContactCache::OnDbEventAdded(WPARAM hContact, LPARAM lParam)
+int __cdecl CContactCache::OnDbEventAdded(WPARAM hContact, LPARAM hEvent)
{
- HANDLE hEvent = (HANDLE)lParam;
-
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hEvent, &dbei);
if (dbei.eventType != EVENTTYPE_MESSAGE)
@@ -91,7 +89,7 @@ void CContactCache::Rebuild() info->hContact = hContact;
info->rate = 0;
- for (HANDLE hEvent = db_event_last(hContact); hEvent; hEvent = db_event_prev(hContact, hEvent)) {
+ for (MEVENT hEvent = db_event_last(hContact); hEvent; hEvent = db_event_prev(hContact, hEvent)) {
DBEVENTINFO dbei = { sizeof(dbei) };
if (!db_event_get(hEvent, &dbei)) {
if (float weight = GetEventWeight(timestamp - dbei.timestamp)) {
diff --git a/plugins/GmailNotifier/src/notify.cpp b/plugins/GmailNotifier/src/notify.cpp index 4e1ee93632..6961d88cf1 100644 --- a/plugins/GmailNotifier/src/notify.cpp +++ b/plugins/GmailNotifier/src/notify.cpp @@ -89,7 +89,7 @@ void NotifyUser(Account *curAcc) if (opt.notifierOnTray&&newMails > 0) {
CLISTEVENT cle = { sizeof(cle) };
cle.hContact = curAcc->hContact;
- cle.hDbEvent = (HANDLE)1;
+ cle.hDbEvent = 1;
cle.flags = CLEF_URGENT;
cle.hIcon = LoadSkinnedProtoIcon(pluginName, ID_STATUS_OCCUPIED);
cle.pszService = "GmailMNotifier/Notifying";
diff --git a/plugins/HistoryLinkListPlus/src/linklist.cpp b/plugins/HistoryLinkListPlus/src/linklist.cpp index b41af89a65..6c374a238e 100644 --- a/plugins/HistoryLinkListPlus/src/linklist.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist.cpp @@ -122,7 +122,7 @@ static INT_PTR LinkList_Main(WPARAM hContact, LPARAM) return 0;
}
- HANDLE hEvent = db_event_first(hContact);
+ MEVENT hEvent = db_event_first(hContact);
if (hEvent == NULL) {
MessageBox(NULL, TXT_EMPTYHISTORY, TXT_PLUGINNAME, (MB_OK | MB_ICONINFORMATION));
return 0;
diff --git a/plugins/HistoryLinkListPlus/src/linklist.h b/plugins/HistoryLinkListPlus/src/linklist.h index f3e89dd275..6bd8bdde50 100644 --- a/plugins/HistoryLinkListPlus/src/linklist.h +++ b/plugins/HistoryLinkListPlus/src/linklist.h @@ -79,7 +79,7 @@ struct LISTELEMENT { TCHAR date[DATE_SIZE];
TCHAR time[TIME_SIZE];
TCHAR link[LINK_MAX];
- HANDLE hEvent;
+ MEVENT hEvent;
int linePos;
struct LISTELEMENT *nextElement;
} ;
@@ -150,7 +150,7 @@ typedef struct { static INT_PTR LinkList_Main(WPARAM, LPARAM);
int InitOptionsDlg(WPARAM, LPARAM);
int DBUpdate(WPARAM, LPARAM);
-int ExtractURI(DBEVENTINFO*, HANDLE, LISTELEMENT*);
+int ExtractURI(DBEVENTINFO*, MEVENT, LISTELEMENT*);
int RemoveList(LISTELEMENT*);
int ListCount(LISTELEMENT*);
diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index ff08afccd6..ab280df73b 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -27,7 +27,7 @@ Miranda core. It looks a bit sophisticated. I'd made a few changes but I didn't really understand what these guys did!
Great job! It works! ;-)
*/
-int ExtractURI(DBEVENTINFO *dbei, HANDLE hEvent, LISTELEMENT *listStart)
+int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart)
{
size_t wordStart, i, j, wordlen, iLastAlphaNum;
size_t charCount = 0, cpLastAlphaNum = 0, cpWordStart;
@@ -618,7 +618,7 @@ void WriteMessage(HWND hDlg, LISTELEMENT *listStart, int actLinePos) LISTELEMENT *actualElement = listStart->nextElement;
while (actualElement != NULL) {
if (actualElement->linePos == actLinePos) {
- HANDLE hEvent = actualElement->hEvent;
+ MEVENT hEvent = actualElement->hEvent;
if (hEvent != NULL ) {
DBEVENTINFO dbe = { sizeof(dbe) };
dbe.cbBlob = db_event_getBlobSize(hEvent);
@@ -1174,9 +1174,8 @@ BYTE GetUpdateSetting(void) Special thanks to Tobi H.!
This function is derived from his Wordlookup Plugin
*/
-int DBUpdate(WPARAM wParam, LPARAM lParam)
+int DBUpdate(WPARAM wParam, LPARAM hEvent)
{
- HANDLE hEvent=(HANDLE)lParam;
HWND hDlg = WindowList_Find(hWindowList, wParam);
DIALOGPARAM *DlgParam;
HMENU listMenu = GetMenu(hDlg);
diff --git a/plugins/HistoryStats/src/mirandacontact.h b/plugins/HistoryStats/src/mirandacontact.h index c91f79853b..7c7876b915 100644 --- a/plugins/HistoryStats/src/mirandacontact.h +++ b/plugins/HistoryStats/src/mirandacontact.h @@ -23,7 +23,7 @@ public: struct ContactInfo {
MCONTACT hContact;
- HANDLE hEvent;
+ MEVENT hEvent;
EventInfo ei;
};
diff --git a/plugins/HistorySweeperLight/src/historysweeperlight.cpp b/plugins/HistorySweeperLight/src/historysweeperlight.cpp index 12042a1b6e..d42546fa51 100644 --- a/plugins/HistorySweeperLight/src/historysweeperlight.cpp +++ b/plugins/HistorySweeperLight/src/historysweeperlight.cpp @@ -81,7 +81,7 @@ int KeepCriteria(int dwti) struct BEventData
{
- HANDLE hDBEvent;
+ MEVENT hDBEvent;
DWORD CRC32;
DWORD Timestamp;
};
@@ -152,7 +152,7 @@ void SweepHistoryFromContact(MCONTACT hContact, CriteriaStruct Criteria, BOOL ke GetBookmarks(hContact, &books, &bookcnt);
// Get first event
- for (HANDLE hDBEvent = db_event_first(hContact); hDBEvent != NULL; ) {
+ for (MEVENT hDBEvent = db_event_first(hContact); hDBEvent != NULL; ) {
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDBEvent, &dbei);
@@ -176,8 +176,7 @@ void SweepHistoryFromContact(MCONTACT hContact, CriteriaStruct Criteria, BOOL ke }
// find next event
- HANDLE hDBEventNext = db_event_next(hContact, hDBEvent);
-
+ MEVENT hDBEventNext = db_event_next(hContact, hDBEvent);
if (doDelete)
db_event_delete(hContact, hDBEvent);
diff --git a/plugins/IEHistory/src/dlgHandlers.cpp b/plugins/IEHistory/src/dlgHandlers.cpp index df09f1ecf2..ddee342acf 100644 --- a/plugins/IEHistory/src/dlgHandlers.cpp +++ b/plugins/IEHistory/src/dlgHandlers.cpp @@ -38,14 +38,14 @@ int LoadIEView(HWND hWnd); int MoveIEView(HWND hWnd); int DestroyIEView(HWND hWnd); int LoadEvents(HWND hWnd); -int LoadPage(HWND hWnd, HANDLE hFirstEvent, long index, long shiftCount, long readCount, int direction); +int LoadPage(HWND hWnd, MEVENT hFirstEvent, long index, long shiftCount, long readCount, int direction); int LoadNext(HWND hWnd); int LoadPrev(HWND hWnd); int ScrollToBottom(HWND hWnd); void RefreshButtonStates(HWND hWnd); -HANDLE GetNeededEvent(HANDLE hLastFirstEvent, int num, int direction); +MEVENT GetNeededEvent(MEVENT hLastFirstEvent, int num, int direction); int CalcIEViewPos(IEVIEWWINDOW *ieWnd, HWND hMainWindow) { @@ -163,7 +163,7 @@ DWORD WINAPI WorkerThread(LPVOID lpvData) int i; IEVIEWEVENTDATA ieData[LOAD_COUNT] = { 0 }; PBYTE messages[LOAD_COUNT] = { 0 }; - HANDLE dbEvent = data->ieEvent.hDbEventFirst; + MEVENT dbEvent = data->ieEvent.hDbEventFirst; for (i = 0; i < LOAD_COUNT; i++) { ieData[i].cbSize = sizeof(IEVIEWEVENTDATA); //set the cbsize here, no need to do it every time ieData[i].next = &ieData[i + 1]; //it's a vector, so v[i]'s next element is v[i + 1] @@ -263,7 +263,7 @@ int LoadEvents(HWND hWnd) ieEvent.hContact = data->contact; ieEvent.count = (data->itemsPerPage <= 0) ? count : data->itemsPerPage; - HANDLE hFirstEvent = db_event_first(data->contact); + MEVENT hFirstEvent = db_event_first(data->contact); int num = 0; if ((data->itemsPerPage > 0) && (bLastFirst)) { num = data->count - data->itemsPerPage; @@ -279,7 +279,7 @@ int LoadEvents(HWND hWnd) return 0; } -int LoadPage(HWND hWnd, HANDLE hFirstEvent, long index, long shiftCount, long readCount, int direction) +int LoadPage(HWND hWnd, MEVENT hFirstEvent, long index, long shiftCount, long readCount, int direction) { HistoryWindowData *data = (HistoryWindowData *)GetWindowLongPtr(hWnd, DWLP_USER); int count = shiftCount; @@ -303,7 +303,7 @@ int LoadPage(HWND hWnd, HANDLE hFirstEvent, long index, long shiftCount, long re } } data->index = newIndex; - HANDLE hEvent = GetNeededEvent(hFirstEvent, count, direction); + MEVENT hEvent = GetNeededEvent(hFirstEvent, count, direction); data->hLastFirstEvent = hEvent; ieEvent.hDbEventFirst = hEvent; ieEvent.count = readCount; diff --git a/plugins/IEHistory/src/dlgHandlers.h b/plugins/IEHistory/src/dlgHandlers.h index f0696a0abc..bf492a5bbf 100644 --- a/plugins/IEHistory/src/dlgHandlers.h +++ b/plugins/IEHistory/src/dlgHandlers.h @@ -33,14 +33,14 @@ struct HistoryWindowData{ int itemsPerPage; int bEnableRTL; HWND hIEView; - HANDLE hLastFirstEvent; + MEVENT hLastFirstEvent; }; struct SearchWindowData{ long index; MCONTACT contact; HWND hHistoryWindow; - HANDLE hLastFoundEvent; + MEVENT hLastFoundEvent; }; INT_PTR CALLBACK HistoryDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); diff --git a/plugins/IEHistory/src/utils.cpp b/plugins/IEHistory/src/utils.cpp index 2b676f8235..e460e3d78d 100644 --- a/plugins/IEHistory/src/utils.cpp +++ b/plugins/IEHistory/src/utils.cpp @@ -198,32 +198,31 @@ void UnixTimeToSystemTime(time_t t, LPSYSTEMTIME pst) SystemTimeToTzSpecificLocalTime(NULL, &st, pst); } -HANDLE GetNeededEvent(HANDLE hEvent, int num, int direction) +MEVENT GetNeededEvent(MEVENT hEvent, int num, int direction) { int i; - typedef HANDLE (__stdcall *db_event_step_t)(MCONTACT hContact,HANDLE hDbEvent); + typedef MEVENT (__stdcall *db_event_step_t)(MCONTACT hContact, MEVENT hDbEvent); db_event_step_t db_event_step; - if(direction==DIRECTION_BACK){ - db_event_step=db_event_prev; - }else{ - db_event_step=db_event_next; - } + if(direction == DIRECTION_BACK) + db_event_step = db_event_prev; + else + db_event_step = db_event_next; - for (i = 0; i < num; ++i){ - hEvent = db_event_step(0,hEvent); - } + for (i = 0; i < num; ++i) + hEvent = db_event_step(0, hEvent); + return hEvent; } -SearchResult SearchHistory(MCONTACT contact, HANDLE hFirstEvent, void *searchData, int direction, int type) +SearchResult SearchHistory(MCONTACT contact, MEVENT hFirstEvent, void *searchData, int direction, int type) { if (hFirstEvent == NULL){ - typedef HANDLE (__stdcall *db_event_start_t)(MCONTACT contact); - db_event_start_t db_event_start=(direction==DIRECTION_BACK) ? db_event_last : db_event_first; - hFirstEvent=db_event_start(contact); + typedef MEVENT (__stdcall *db_event_start_t)(MCONTACT contact); + db_event_start_t db_event_start = (direction == DIRECTION_BACK) ? db_event_last : db_event_first; + hFirstEvent = db_event_start(contact); } int index = 0; - HANDLE hEvent = hFirstEvent; + MEVENT hEvent = hFirstEvent; void *buffer = NULL; TCHAR *search; bool found = false; diff --git a/plugins/IEHistory/src/utils.h b/plugins/IEHistory/src/utils.h index 2d7605b7b1..7cdf8186f6 100644 --- a/plugins/IEHistory/src/utils.h +++ b/plugins/IEHistory/src/utils.h @@ -54,7 +54,7 @@ struct TimeSearchData{ struct SearchResult{ long index; - HANDLE hEvent; + MEVENT hEvent; }; #ifdef _DEBUG @@ -75,8 +75,8 @@ RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, void UnixTimeToFileTime(time_t t, LPFILETIME pft); void UnixTimeToSystemTime(time_t t, LPSYSTEMTIME pst); -HANDLE GetNeededEvent(HANDLE hLastFirstEvent, int num, int direction); -SearchResult SearchHistory(MCONTACT contact, HANDLE hFirstEvent, void *searchData, int direction, int type); +MEVENT GetNeededEvent(MEVENT hLastFirstEvent, int num, int direction); +SearchResult SearchHistory(MCONTACT contact, MEVENT hFirstEvent, void *searchData, int direction, int type); /* static __inline int mir_snprintf(char *buffer, size_t count, const char* fmt, ...) { diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index de6b85d0d2..9480e4c420 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -304,7 +304,7 @@ void HTMLBuilder::appendEventOld(IEView *view, IEVIEWEVENT *event) {
IEVIEWEVENTDATA* eventData;
IEVIEWEVENTDATA* prevEventData = NULL;
- HANDLE hDbEvent = event->hDbEventFirst;
+ MEVENT hDbEvent = event->hDbEventFirst;
event->hDbEventFirst = NULL;
ptrA szProto;
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp index b0d5cd27c8..f4b91dcaab 100644 --- a/plugins/Import/src/import.cpp +++ b/plugins/Import/src/import.cpp @@ -873,7 +873,7 @@ static void ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int protoC BYTE *eventBuf = (PBYTE)mir_alloc(cbAlloc);
// Get the start of the event chain
- HANDLE hEvent = srcDb->FindFirstEvent(hContact);
+ MEVENT hEvent = srcDb->FindFirstEvent(hContact);
for (int i = 0; hEvent; i++, hEvent = srcDb->FindNextEvent(hContact, hEvent)) {
// Copy the event and import it
DBEVENTINFO dbei = { sizeof(DBEVENTINFO) };
diff --git a/plugins/Import/src/utils.cpp b/plugins/Import/src/utils.cpp index afb7250145..f224873f78 100644 --- a/plugins/Import/src/utils.cpp +++ b/plugins/Import/src/utils.cpp @@ -77,10 +77,10 @@ bool IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO dbei) {
static DWORD dwPreviousTimeStamp = -1;
static MCONTACT hPreviousContact = INVALID_CONTACT_ID;
- static HANDLE hPreviousDbEvent = NULL;
+ static MEVENT hPreviousDbEvent = NULL;
// get last event
- HANDLE hExistingDbEvent = db_event_last(hContact);
+ MEVENT hExistingDbEvent = db_event_last(hContact);
if (hExistingDbEvent == NULL)
return FALSE;
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index cbcdc60627..ae7e48fd98 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -24,7 +24,7 @@ #include "Common.h" -#define NCONVERS_BLINKID ((HANDLE)123456) //nconvers' random identifier used to flash an icon for "incoming message" on contact list +#define NCONVERS_BLINKID ((MEVENT)123456) //nconvers' random identifier used to flash an icon for "incoming message" on contact list HINSTANCE hInst; @@ -202,7 +202,7 @@ DBEVENTINFO createMsgEventInfo(MCONTACT hContact) return einfo; } -DBEVENTINFO readEventInfo(HANDLE hDbEvent, MCONTACT hContact) +DBEVENTINFO readEventInfo(MEVENT hDbEvent, MCONTACT hContact) { if (hDbEvent == NCONVERS_BLINKID) // we need to handle nconvers' blink event return createMsgEventInfo(hContact); @@ -330,12 +330,12 @@ static void FlashThreadFunction() } } -BOOL checkMsgTimestamp(MCONTACT hContact, HANDLE hEventCurrent, DWORD timestampCurrent) +BOOL checkMsgTimestamp(MCONTACT hContact, MEVENT hEventCurrent, DWORD timestampCurrent) { if (!bFlashIfMsgOlder) return TRUE; - for (HANDLE hEvent = db_event_prev(hContact, hEventCurrent); hEvent; hEvent = db_event_prev(hContact, hEvent)) { + for (MEVENT hEvent = db_event_prev(hContact, hEventCurrent); hEvent; hEvent = db_event_prev(hContact, hEvent)) { DBEVENTINFO einfo = { sizeof(einfo) }; if(!db_event_get(hEvent, &einfo)) { if ((einfo.timestamp + wSecondsOlder) <= timestampCurrent) @@ -395,10 +395,8 @@ BOOL checkXstatus(char *szProto) // 'Pings' the FlashThread to keep the LEDs flashing. -static int PluginMessageEventHook(WPARAM hContact, LPARAM lParam) +static int PluginMessageEventHook(WPARAM hContact, LPARAM hEvent) { - HANDLE hEvent = (HANDLE)lParam; - //get DBEVENTINFO without pBlob DBEVENTINFO einfo = { sizeof(einfo) }; if (!db_event_get(hEvent, &einfo) && !(einfo.flags & DBEF_SENT)) diff --git a/plugins/MirOTR/MirOTR/src/dbfilter.cpp b/plugins/MirOTR/MirOTR/src/dbfilter.cpp index 7ee8866104..4def70e5e8 100644 --- a/plugins/MirOTR/MirOTR/src/dbfilter.cpp +++ b/plugins/MirOTR/MirOTR/src/dbfilter.cpp @@ -8,7 +8,7 @@ struct DeleteEventNode { DeleteEventNode *next;
time_t timestamp;
MCONTACT hContact;
- HANDLE hDbEvent;
+ MEVENT hDbEvent;
};
struct DeleteEventHead {
DeleteEventNode *first;
@@ -193,7 +193,7 @@ int OnDatabaseEventPreAdd(WPARAM hContact, LPARAM lParam) DBEVENTINFO info = { sizeof(info) };
info.cbBlob = lenutf*2;
info.pBlob = (PBYTE)mir_alloc(info.cbBlob);
- if (!db_event_get((HANDLE)lParam, &info)) {
+ if (!db_event_get(lParam, &info)) {
if(info.eventType == EVENTTYPE_MESSAGE) {
MCONTACT hSub;
if((hSub = db_mc_getMostOnline(hContact)) != 0)
@@ -208,7 +208,7 @@ int OnDatabaseEventPreAdd(WPARAM hContact, LPARAM lParam) {
DeleteEventNode *node = new DeleteEventNode();
node->hContact = hContact;
- node->hDbEvent = (HANDLE) lParam;
+ node->hDbEvent = lParam;
node->timestamp = time(0);
node->next = 0;
EnterCriticalSection(lpRemoveChainCS);
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index a6456866f8..dbc34fd1c3 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -797,7 +797,7 @@ void CAppletManager::SendTypingNotification(MCONTACT hContact,bool bEnable) //************************************************************************ // sends a message to the specified contact //************************************************************************ -HANDLE CAppletManager::SendMessageToContact(MCONTACT hContact,tstring strMessage) +MEVENT CAppletManager::SendMessageToContact(MCONTACT hContact,tstring strMessage) { tstring strAscii = _A2T(toNarrowString(strMessage).c_str()); int bufSize = mir_tstrlen(strAscii.c_str())+1; @@ -870,7 +870,7 @@ HANDLE CAppletManager::SendMessageToContact(MCONTACT hContact,tstring strMessage pJob->pcBuffer = NULL; return NULL; } - pJob->hEvent = (HANDLE) CallContactService(pJob->hContact, szService , pref, (LPARAM)pJob->pcBuffer ); + pJob->hEvent = (MEVENT)CallContactService(pJob->hContact, szService , pref, (LPARAM)pJob->pcBuffer ); CAppletManager::GetInstance()->AddMessageJob(pJob); } @@ -898,7 +898,7 @@ bool CAppletManager::IsMessageWindowOpen(MCONTACT hContact) //************************************************************************ // marks the given message as read //************************************************************************ -void CAppletManager::MarkMessageAsRead(MCONTACT hContact,HANDLE hEvent) +void CAppletManager::MarkMessageAsRead(MCONTACT hContact,MEVENT hEvent) { db_event_markRead(hContact, hEvent); CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM)hEvent); @@ -907,12 +907,8 @@ void CAppletManager::MarkMessageAsRead(MCONTACT hContact,HANDLE hEvent) //************************************************************************ // translates the given database event //************************************************************************ -bool CAppletManager::TranslateDBEvent(CEvent *pEvent,WPARAM wParam, LPARAM lParam) +bool CAppletManager::TranslateDBEvent(CEvent *pEvent, WPARAM hContact, LPARAM hdbevent) { - MCONTACT hContact = wParam; - HANDLE hdbevent = (HANDLE)lParam; - - // Create struct for dbevent DBEVENTINFO dbevent; memset(&dbevent, 0, sizeof(dbevent)); @@ -1240,7 +1236,7 @@ int CAppletManager::HookChatInbound(WPARAM wParam,LPARAM lParam) else Event.eType = EVENT_IRC_RECEIVED; Event.iValue = gcd->iType; - Event.hValue = (HANDLE)lParam; + Event.hValue = lParam; CIRCHistory *pHistory = NULL; if(gcd->ptszID) @@ -1673,10 +1669,10 @@ int CAppletManager::HookProtoAck(WPARAM wParam, LPARAM lParam) list<SMessageJob*>::iterator iter = CAppletManager::GetInstance()->m_MessageJobs.begin(); while(iter != CAppletManager::GetInstance()->m_MessageJobs.end()) { - if((*iter)->hEvent == pAck->hProcess && (*iter)->hContact == pAck->hContact) + if((*iter)->hEvent == (MEVENT)pAck->hProcess && (*iter)->hContact == pAck->hContact) { Event.eType = EVENT_MESSAGE_ACK; - Event.hValue = pAck->hProcess; + Event.hValue = (MEVENT)pAck->hProcess; Event.hContact = pAck->hContact; Event.iValue = pAck->result; if(pAck->lParam != 0) diff --git a/plugins/MirandaG15/src/CAppletManager.h b/plugins/MirandaG15/src/CAppletManager.h index e95a063cb8..5af6058273 100644 --- a/plugins/MirandaG15/src/CAppletManager.h +++ b/plugins/MirandaG15/src/CAppletManager.h @@ -18,7 +18,7 @@ struct SMessageJob
{
- HANDLE hEvent;
+ MEVENT hEvent;
MCONTACT hContact;
DWORD dwFlags;
char *pcBuffer;
@@ -75,11 +75,11 @@ public: // check if a contacts message window is opened
static bool IsMessageWindowOpen(MCONTACT hContact);
// marks the given event as read
- static void MarkMessageAsRead(MCONTACT hContact,HANDLE hEvent);
+ static void MarkMessageAsRead(MCONTACT hContact, MEVENT hEvent);
// translates the given database event
static bool TranslateDBEvent(CEvent *pEvent,WPARAM wParam, LPARAM lParam);
// sends a message to the specified contact
- static HANDLE SendMessageToContact(MCONTACT hContact,tstring strMessage);
+ static MEVENT SendMessageToContact(MCONTACT hContact,tstring strMessage);
// sends typing notifications to the specified contact
static void SendTypingNotification(MCONTACT hContact,bool bEnable);
diff --git a/plugins/MirandaG15/src/CChatScreen.cpp b/plugins/MirandaG15/src/CChatScreen.cpp index f519baaae8..34a82de04f 100644 --- a/plugins/MirandaG15/src/CChatScreen.cpp +++ b/plugins/MirandaG15/src/CChatScreen.cpp @@ -303,9 +303,9 @@ void CChatScreen::LoadHistory() {
// Get last events from database
CEvent Event;
- list<HANDLE> LHandles;
- HANDLE hEvent = db_event_last(m_hContact);
- HANDLE hUnread = db_event_firstUnread(m_hContact);
+ list<MEVENT> LHandles;
+ MEVENT hEvent = db_event_last(m_hContact);
+ MEVENT hUnread = db_event_firstUnread(m_hContact);
if(CConfig::GetBoolSetting(SESSION_LOADDB))
{
diff --git a/plugins/MirandaG15/src/CChatScreen.h b/plugins/MirandaG15/src/CChatScreen.h index 0f10a17614..4f1582083b 100644 --- a/plugins/MirandaG15/src/CChatScreen.h +++ b/plugins/MirandaG15/src/CChatScreen.h @@ -93,7 +93,7 @@ protected: DWORD m_dwMaximizedDuration;
MCONTACT m_hContact;
- HANDLE m_hMessage;
+ MEVENT m_hMessage;
int m_iStatus;
diff --git a/plugins/MirandaG15/src/CContactList.cpp b/plugins/MirandaG15/src/CContactList.cpp index 69e6165d38..965607226c 100644 --- a/plugins/MirandaG15/src/CContactList.cpp +++ b/plugins/MirandaG15/src/CContactList.cpp @@ -905,9 +905,7 @@ void CContactList::UpdateMessageCounter(CListEntry<CContactListEntry*,CContactLi int iOldMessages = pEntry->iMessages;
bool bSort = false;
- HANDLE hEvent= NULL;
-
- hEvent = db_event_firstUnread(pEntry->hHandle);
+ MEVENT hEvent = db_event_firstUnread(pEntry->hHandle);
if(CAppletManager::IsMessageWindowOpen(pEntry->hHandle) || (hEvent == NULL && pEntry->iMessages > 0))
{
pEntry->iMessages = 0;
@@ -916,7 +914,7 @@ void CContactList::UpdateMessageCounter(CListEntry<CContactListEntry*,CContactLi else
{
pEntry->iMessages = 0;
- HANDLE hLastEvent = db_event_last(pEntry->hHandle);
+ MEVENT hLastEvent = db_event_last(pEntry->hHandle);
while(hLastEvent != NULL && hEvent != NULL)
{
pEntry->iMessages++;
diff --git a/plugins/MirandaG15/src/CEvent.h b/plugins/MirandaG15/src/CEvent.h index d07080b70c..c94e98d108 100644 --- a/plugins/MirandaG15/src/CEvent.h +++ b/plugins/MirandaG15/src/CEvent.h @@ -63,7 +63,7 @@ public: tstring strDescription;
tstring strSummary;
- HANDLE hValue;
+ MEVENT hValue;
int iValue;
tstring strValue;
};
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 1390af62c4..0c14b89862 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -57,9 +57,9 @@ class CLDBEvent DWORD time;
public:
MCONTACT hUser;
- HANDLE hDbEvent;
+ MEVENT hDbEvent;
- CLDBEvent(MCONTACT hU, HANDLE hDBE )
+ CLDBEvent(MCONTACT hU, MEVENT hDBE)
{
hUser = hU;
hDbEvent = hDBE;
@@ -221,9 +221,9 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected ) MCONTACT hContact = (MCONTACT)sItem.lParam;
- list< CLDBEvent > & rclCurList = AllEvents[ GetFilePathFromUser( hContact) ];
+ list<CLDBEvent> &rclCurList = AllEvents[ GetFilePathFromUser( hContact) ];
- HANDLE hDbEvent = db_event_first(hContact);
+ MEVENT hDbEvent = db_event_first(hContact);
while( hDbEvent) {
rclCurList.push_back(CLDBEvent(hContact, hDbEvent));
hDbEvent = db_event_next(hContact, hDbEvent);
@@ -260,7 +260,7 @@ int nExportCompleatList(HWND hParent, bool bOnlySelected ) list< CLDBEvent >::const_iterator iterator;
for (iterator = FileIterator->second.begin() ; iterator != FileIterator->second.end() ; ++iterator )
{
- HANDLE hDbEvent = (*iterator).hDbEvent;
+ MEVENT hDbEvent = (*iterator).hDbEvent;
nExportEvent( (WPARAM) (*iterator).hUser, (LPARAM)hDbEvent);
}
SendMessage( hProg, PBM_SETPOS, ++nCur, 0);
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 1db6774808..3adbec1191 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -1408,10 +1408,8 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei ) /////////////////////////////////////////////////////////////////////
-int nExportEvent(WPARAM wparam,LPARAM lparam)
+int nExportEvent(WPARAM hContact, LPARAM hDbEvent)
{
- MCONTACT hContact = (MCONTACT)wparam;
- HANDLE hDbEvent = (HANDLE)lparam;
if ( !db_get_b(hContact,MODULE,"EnableLog",1))
return 0;
diff --git a/plugins/NewEventNotify/src/main.cpp b/plugins/NewEventNotify/src/main.cpp index 9c5f46a6e2..63fd90ea86 100644 --- a/plugins/NewEventNotify/src/main.cpp +++ b/plugins/NewEventNotify/src/main.cpp @@ -60,7 +60,7 @@ HANDLE hHookedDeletedEvent; //wParam: contact-handle
//lParam: dbevent-handle
-int HookedNewEvent(WPARAM hContact, LPARAM lParam)
+int HookedNewEvent(WPARAM hContact, LPARAM hDbEvent)
{
//are popups currently enabled?
if (pluginOptions.bDisable)
@@ -68,7 +68,7 @@ int HookedNewEvent(WPARAM hContact, LPARAM lParam) //get DBEVENTINFO without pBlob
DBEVENTINFO dbe = { sizeof(dbe) };
- db_event_get((HANDLE)lParam, &dbe);
+ db_event_get(hDbEvent, &dbe);
//do not show popups for sub-contacts
if (hContact && db_mc_isSub(hContact))
@@ -103,9 +103,9 @@ int HookedNewEvent(WPARAM hContact, LPARAM lParam) //is another popup for this contact already present? -> merge message popups if enabled
if (dbe.eventType == EVENTTYPE_MESSAGE && (pluginOptions.bMergePopup && NumberPopupData(hContact, EVENTTYPE_MESSAGE) != -1))
- PopupUpdate(hContact, (HANDLE)lParam);
+ PopupUpdate(hContact, hDbEvent);
else
- PopupShow(&pluginOptions, hContact, (HANDLE)lParam, (UINT)dbe.eventType);
+ PopupShow(&pluginOptions, hContact, hDbEvent, (UINT)dbe.eventType);
return 0;
}
diff --git a/plugins/NewEventNotify/src/neweventnotify.h b/plugins/NewEventNotify/src/neweventnotify.h index 31e6295c3d..1d73bb6d6c 100644 --- a/plugins/NewEventNotify/src/neweventnotify.h +++ b/plugins/NewEventNotify/src/neweventnotify.h @@ -189,7 +189,7 @@ struct PLUGIN_OPTIONS struct EVENT_DATA_EX
{
- HANDLE hEvent;
+ MEVENT hEvent;
int number;
struct EVENT_DATA_EX* next;
struct EVENT_DATA_EX* prev;
@@ -212,8 +212,8 @@ struct PLUGIN_DATA //---------------------------
//---External Procedure Definitions
-int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, HANDLE hEvent, UINT eventType);
-int PopupUpdate(MCONTACT hContact, HANDLE hEvent);
+int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, MEVENT hEvent, UINT eventType);
+int PopupUpdate(MCONTACT hContact, MEVENT hEvent);
int PopupPreview(PLUGIN_OPTIONS* pluginOptions);
int PopupAct(HWND hWnd, UINT mask, PLUGIN_DATA* pdata);
int OptionsInit(PLUGIN_OPTIONS* pluginOptions);
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp index eb514b5406..e6b9e894d9 100644 --- a/plugins/NewEventNotify/src/popup.cpp +++ b/plugins/NewEventNotify/src/popup.cpp @@ -400,7 +400,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) return TranslateTS( mir_a2t(commentFix));
}
-int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, HANDLE hEvent, UINT eventType)
+int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, MEVENT hEvent, UINT eventType)
{
TCHAR* sampleEvent;
long iSeconds;
@@ -517,7 +517,7 @@ int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, HANDLE hEvent, U }
-int PopupUpdate(MCONTACT hContact, HANDLE hEvent)
+int PopupUpdate(MCONTACT hContact, MEVENT hEvent)
{
// merge only message popups
PLUGIN_DATA *pdata = (PLUGIN_DATA*)PopupList[NumberPopupData(hContact, EVENTTYPE_MESSAGE)];
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index 18d3ee05ef..14cdf6b503 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -287,7 +287,7 @@ void LogSMsgToDB(STATUSMSGINFO *smi, const TCHAR *tmplt) dbei.timestamp = (DWORD)time(NULL);
dbei.szModule = MODULE;
- HANDLE hDBEvent = db_event_add(smi->hContact, &dbei);
+ MEVENT hDBEvent = db_event_add(smi->hContact, &dbei);
mir_free(blob);
mir_free(str);
@@ -330,7 +330,7 @@ void BlinkIcon(MCONTACT hContact, HICON hIcon, TCHAR *stzText) cle.cbSize = sizeof(cle);
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
cle.hContact = hContact;
- cle.hDbEvent = (HANDLE)hContact;
+ cle.hDbEvent = hContact;
cle.hIcon = hIcon;
cle.pszService = "UserOnline/Description";
cle.ptszTooltip = stzText;
@@ -376,7 +376,7 @@ int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus) dbei.timestamp = (DWORD)time(NULL);
dbei.szModule = MODULE;
- HANDLE hDBEvent = db_event_add(hContact, &dbei);
+ MEVENT hDBEvent = db_event_add(hContact, &dbei);
mir_free(blob);
if (opt.LogToDB_WinOpen && opt.LogToDB_Remove) {
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp index 786ffe4265..f8dae508eb 100644 --- a/plugins/NewXstatusNotify/src/xstatus.cpp +++ b/plugins/NewXstatusNotify/src/xstatus.cpp @@ -325,7 +325,7 @@ void LogChangeToDB(XSTATUSCHANGE *xsc) dbei.timestamp = (DWORD)time(NULL);
dbei.szModule = MODULE;
- HANDLE hDBEvent = db_event_add(xsc->hContact, &dbei);
+ MEVENT hDBEvent = db_event_add(xsc->hContact, &dbei);
mir_free(blob);
if (opt.XLogToDB_WinOpen && opt.XLogToDB_Remove) {
diff --git a/plugins/NewXstatusNotify/src/xstatus.h b/plugins/NewXstatusNotify/src/xstatus.h index 9d30a65d23..1c82461245 100644 --- a/plugins/NewXstatusNotify/src/xstatus.h +++ b/plugins/NewXstatusNotify/src/xstatus.h @@ -95,7 +95,7 @@ typedef struct tagXSTATUSCHANGE typedef struct tagDBEVENT
{
MCONTACT hContact;
- HANDLE hDBEvent;
+ MEVENT hDBEvent;
} DBEVENT;
typedef struct tagPROTOTEMPLATE
diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp index 1920ff7f4c..08888867a9 100644 --- a/plugins/NewsAggregator/Src/CheckFeed.cpp +++ b/plugins/NewsAggregator/Src/CheckFeed.cpp @@ -126,7 +126,7 @@ static void XmlToMsg(MCONTACT hContact, CMString &title, CMString &link, CMStrin ptrA pszTemp(mir_utf8encodeT(message));
DWORD cbMemoLen = 10000, cbOrigLen = (DWORD)strlen(pszTemp);
BYTE *pbBuffer = (BYTE*)mir_alloc(cbMemoLen);
- for (HANDLE hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) {
+ for (MEVENT hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) {
olddbei.cbBlob = db_event_getBlobSize(hDbEvent);
if (olddbei.cbBlob > cbMemoLen)
pbBuffer = (PBYTE)mir_realloc(pbBuffer, (size_t)(cbMemoLen = olddbei.cbBlob));
diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp index 93f2f3c9f5..53c4df12b4 100644 --- a/plugins/NoHistory/src/dllmain.cpp +++ b/plugins/NoHistory/src/dllmain.cpp @@ -21,7 +21,7 @@ CRITICAL_SECTION list_cs; // a list of db events - we'll check them for the 'read' flag periodically and delete them whwen marked as read
struct EventListNode {
MCONTACT hContact;
- HANDLE hDBEvent;
+ MEVENT hDBEvent;
EventListNode *next;
};
@@ -99,9 +99,9 @@ void RemoveReadEvents(MCONTACT hContact = 0) void RemoveAllEvents(MCONTACT hContact)
{
- 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;
}
@@ -112,16 +112,14 @@ void CALLBACK TimerProc(HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) RemoveReadEvents();
}
-int OnDatabaseEventAdd(WPARAM hContact, LPARAM lParam)
+int OnDatabaseEventAdd(WPARAM hContact, LPARAM hDBEvent)
{
- HANDLE hDBEvent = (HANDLE)lParam;
-
// history not disabled for this contact
if (db_get_b(hContact, MODULE, DBSETTING_REMOVE, 0) == 0)
return 0;
DBEVENTINFO info = { sizeof(info) };
- if ( !db_event_get(hDBEvent, &info)) {
+ if (!db_event_get(hDBEvent, &info)) {
if (info.eventType == EVENTTYPE_MESSAGE) {
EventListNode *node = (EventListNode *)malloc(sizeof(EventListNode));
node->hContact = hContact;
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 2ae6d2011b..3e77ddff60 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -196,10 +196,10 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) // called when a message/file/url was sent
// handle of contact is set as window-userdata
-int EventAdded(WPARAM wparam, LPARAM lparam)
+int EventAdded(WPARAM wparam, LPARAM hDbEvent)
{
DBEVENTINFO dbei = { sizeof(dbei) };
- db_event_get((HANDLE)lparam, &dbei);
+ db_event_get(hDbEvent, &dbei);
if ( !(dbei.flags & DBEF_SENT) || (dbei.flags & DBEF_READ)
|| !db_get_b(NULL, MODULE_NAME, "EnableLastSentTo", 0)
|| db_get_w(NULL, MODULE_NAME, "MsgTypeRec", TYPE_GLOBAL) != TYPE_GLOBAL)
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index f176a8e77b..7a59f49016 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -414,7 +414,7 @@ INT_PTR OnMenuCommandShowList(WPARAM wParam, LPARAM lParam) dbe.cbSize = sizeof(dbe);
BYTE buf[1];
dbe.pBlob = buf;
- HANDLE curEvent;
+ MEVENT curEvent;
for (MCONTACT curContact = db_find_first(); curContact != NULL; curContact = db_find_next(curContact)) {
curTime = ((__time64_t)db_get_dw(curContact, dbLastUC_ModuleName, dbLastUC_LastUsedTimeLo, -1)) |
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index d3b6176531..ac901b462b 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -222,13 +222,10 @@ void SetProtocolsOffline() void RemoveUsers()
{
if ( GetSettingBool("GlobalSettings", "RemoveAllUsers", TRUE) ) {
- MCONTACT hContact, hContactOld;
- HANDLE hDbEvent;
-
// To be faster, remove first all metacontacts (because it syncs histories)
- hContact = db_find_first();
+ MCONTACT hContact = db_find_first();
while(hContact != NULL) {
- hContactOld = hContact;
+ MCONTACT hContactOld = hContact;
hContact = db_find_next(hContact);
if (isMetaContact(hContactOld) )
@@ -244,11 +241,10 @@ void RemoveUsers() }
// Delete events for contacts not in list
- hDbEvent = db_event_first(0);
+ MEVENT hDbEvent = db_event_first(0);
while(hDbEvent != NULL) {
int ret = db_event_delete(0, hDbEvent);
-
hDbEvent = db_event_first(0);
}
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp index 05678d0046..6e594bea8e 100644 --- a/plugins/SMS/src/SMS_svc.cpp +++ b/plugins/SMS/src/SMS_svc.cpp @@ -135,7 +135,7 @@ void RestoreUnreadMessageAlerts(void) DBEVENTINFO dbei = { sizeof(dbei) };
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
- 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)) {
dbei.cbBlob = 0;
if (db_event_get(hDbEvent, &dbei) == 0)
if ((dbei.flags & (DBEF_SENT|DBEF_READ))==0 && ((dbei.eventType==ICQEVENTTYPE_SMS) || (dbei.eventType==ICQEVENTTYPE_SMSCONFIRMATION)))
@@ -143,7 +143,7 @@ void RestoreUnreadMessageAlerts(void) handleNewMessage(hContact,(LPARAM)hDbEvent);
}
- for (HANDLE hDbEvent = db_event_firstUnread(NULL); hDbEvent; hDbEvent = db_event_next(NULL, hDbEvent)) {
+ for (MEVENT hDbEvent = db_event_firstUnread(NULL); hDbEvent; hDbEvent = db_event_next(NULL, hDbEvent)) {
dbei.cbBlob = 0;
if (db_event_get(hDbEvent, &dbei) == 0)
if ((dbei.flags & (DBEF_SENT|DBEF_READ))==0 && ((dbei.eventType==ICQEVENTTYPE_SMS) || (dbei.eventType==ICQEVENTTYPE_SMSCONFIRMATION)))
diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp index fa2d31764f..813cd77ffd 100644 --- a/plugins/SMS/src/receive.cpp +++ b/plugins/SMS/src/receive.cpp @@ -74,7 +74,7 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) dbei.cbBlob=(mir_snprintf((LPSTR)dbei.pBlob,((dwBuffLen+dwPhoneSize)),"SMS From: +%s\r\n%s",szPhone,lpszMessageUTF)+sizeof(DWORD));
//dbei.pBlob=(LPBYTE)lpszBuff;
(*((DWORD*)(dbei.pBlob+(dbei.cbBlob-sizeof(DWORD)))))=0;
- HANDLE hResult = db_event_add(hContact, &dbei);
+ MEVENT hResult = db_event_add(hContact, &dbei);
if (hContact==NULL) {
if ( RecvSMSWindowAdd(NULL,ICQEVENTTYPE_SMS,tszPhone,dwPhoneSize,(LPSTR)dbei.pBlob,dbei.cbBlob)) {
db_event_markRead(hContact, hResult);
@@ -212,11 +212,10 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) }
//Handles new SMS messages added to the database
-int handleNewMessage(WPARAM hContact, LPARAM lParam)
+int handleNewMessage(WPARAM hContact, LPARAM hDbEvent)
{
char szServiceFunction[MAX_PATH], *pszServiceFunctionName;
TCHAR szToolTip[MAX_PATH];
- HANDLE hDbEvent = (HANDLE)lParam;
DBEVENTINFO dbei = { sizeof(dbei) };
if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == -1)
@@ -256,7 +255,7 @@ int handleNewMessage(WPARAM hContact, LPARAM lParam) SkinPlaySound("RecvSMSConfirmation");
if (DB_SMS_GetByte(NULL, "AutoPopup", 0)) {
if (RecvSMSWindowAdd(hContact,ICQEVENTTYPE_SMSCONFIRMATION,NULL,0,(LPSTR)dbei.pBlob,dbei.cbBlob))
- db_event_delete(hContact, &dbei);
+ db_event_delete(hContact, hDbEvent);
}
else {
UINT iIcon;
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 830b49d04b..31a3413a90 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -852,7 +852,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
DBEVENTINFO dbei = { sizeof(dbei) };
- HANDLE hPrevEvent;
+ MEVENT hPrevEvent;
switch (historyMode) {
case LOADHISTORY_COUNT:
for (int i = db_get_w(NULL, SRMMMOD, SRMSGSET_LOADCOUNT, SRMSGDEFSET_LOADCOUNT); i > 0; i--) {
@@ -896,7 +896,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
SendMessage(dat->hwndParent, CM_ADDCHILD, (WPARAM)hwndDlg, dat->hContact);
{
- HANDLE hdbEvent = db_event_last(dat->hContact);
+ MEVENT hdbEvent = db_event_last(dat->hContact);
if (hdbEvent) {
DBEVENTINFO dbei = { sizeof(dbei) };
do {
@@ -1221,7 +1221,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP //fall through
case WM_MOUSEACTIVATE:
if (dat->hDbUnreadEventFirst != NULL) {
- HANDLE hDbEvent = dat->hDbUnreadEventFirst;
+ MEVENT hDbEvent = dat->hDbUnreadEventFirst;
dat->hDbUnreadEventFirst = NULL;
while (hDbEvent != NULL) {
DBEVENTINFO dbei = { sizeof(dbei) };
@@ -1311,7 +1311,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP break;
case DM_APPENDTOLOG: //takes wParam=hDbEvent
- StreamInEvents(hwndDlg, (HANDLE)wParam, 1, 1);
+ StreamInEvents(hwndDlg, wParam, 1, 1);
break;
case DM_SCROLLLOGTOBOTTOM:
@@ -1342,7 +1342,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case HM_DBEVENTADDED:
if (wParam == dat->hContact) {
- HANDLE hDbEvent = (HANDLE)lParam;
+ MEVENT hDbEvent = lParam;
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
if (dat->hDbEventFirst == NULL)
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 4d7631dba9..a5f6297500 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -75,7 +75,7 @@ struct LogStreamData {
int stage;
MCONTACT hContact;
- HANDLE hDbEvent, hDbEventLast;
+ MEVENT hDbEvent, hDbEventLast;
char *buffer;
size_t bufferOffset, bufferLen;
int eventsToInsert;
@@ -151,7 +151,7 @@ int DbEventIsShown(DBEVENTINFO &dbei) return DbEventIsCustomForMsgWindow(&dbei);
}
-EventData* getEventFromDB(SrmmWindowData *dat, MCONTACT hContact, HANDLE hDbEvent)
+EventData* getEventFromDB(SrmmWindowData *dat, MCONTACT hContact, MEVENT hDbEvent)
{
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.cbBlob = db_event_getBlobSize(hDbEvent);
@@ -814,7 +814,7 @@ void StreamInTestEvents(HWND hEditWnd, GlobalMessageData *gdat) SendMessage(hEditWnd, EM_HIDESELECTION, FALSE, 0);
}
-void StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend)
+void StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAppend)
{
FINDTEXTEXA fi;
EDITSTREAM stream = { 0 };
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index 913e429db6..e4a6022401 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -89,7 +89,7 @@ static INT_PTR ReadMessageCommand(WPARAM, LPARAM lParam) static int MessageEventAdded(WPARAM hContact, LPARAM lParam)
{
- HANDLE hDbEvent = (HANDLE)lParam;
+ MEVENT hDbEvent = (MEVENT)lParam;
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
if (dbei.eventType == EVENTTYPE_MESSAGE && (dbei.flags & DBEF_READ))
@@ -221,7 +221,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) else {
CLISTEVENT cle = { sizeof(cle) };
cle.hContact = hContact;
- cle.hDbEvent = (HANDLE)1;
+ cle.hDbEvent = 1;
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
cle.hIcon = GetCachedIcon("scriver_TYPING");
cle.pszService = "SRMsg/TypingMessage";
@@ -263,7 +263,7 @@ static void RestoreUnreadMessageAlerts(void) cle.ptszTooltip = toolTip;
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- 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)) {
dbei.cbBlob = 0;
db_event_get(hDbEvent, &dbei);
if (!(dbei.flags & (DBEF_SENT | DBEF_READ)) && DbEventIsMessageOrCustom(&dbei)) {
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index c823caff29..cc991e6c87 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -119,7 +119,7 @@ struct SrmmWindowData : public CommonWindowData MCONTACT hContact;
int tabId;
HWND hwndParent;
- HANDLE hDbEventFirst, hDbEventLast, hDbUnreadEventFirst;
+ MEVENT hDbEventFirst, hDbEventLast, hDbUnreadEventFirst;
int splitterPos;
int desiredInputAreaHeight;
SIZE toolbarSize;
@@ -225,7 +225,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar int DbEventIsShown(DBEVENTINFO &dbei);
int DbEventIsCustomForMsgWindow(DBEVENTINFO *dbei);
int DbEventIsMessageOrCustom(DBEVENTINFO *dbei);
-void StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend);
+void StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAppend);
void LoadMsgLogIcons(void);
void FreeMsgLogIcons(void);
TCHAR *GetNickname(MCONTACT hContact, const char *szProto);
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 8f465e07f7..1f913fd0fc 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -181,11 +181,9 @@ TCHAR* StrReplace (TCHAR* Search, TCHAR* Replace, TCHAR* Resource) return Resource;
}
-INT addEvent(WPARAM hContact, LPARAM lParam)
+INT addEvent(WPARAM hContact, LPARAM hDBEvent)
{
- HANDLE hDBEvent = (HANDLE)lParam;
BOOL fEnabled = db_get_b(NULL, protocolname, KEY_ENABLED, 1);
-
if (!fEnabled || !hContact || !hDBEvent)
return FALSE; /// unspecifyed error
diff --git a/plugins/StatusChange/src/main.cpp b/plugins/StatusChange/src/main.cpp index 56b307c369..a012ac24ec 100644 --- a/plugins/StatusChange/src/main.cpp +++ b/plugins/StatusChange/src/main.cpp @@ -43,9 +43,8 @@ void LoadOptions() Options.IfOuttolunch = (BOOL)db_get_b(NULL, PLUGINNAME, "IfOuttolunch", FALSE);
}
-static int StatusChangeGetMessage(WPARAM wParam, LPARAM lParam)
+static int StatusChangeGetMessage(WPARAM wParam, LPARAM hDbEvent)
{
- HANDLE hDbEvent = (HANDLE)lParam;
int status;
BOOL read, send, change_status;
diff --git a/plugins/StopSpamMod/src/stopspam.cpp b/plugins/StopSpamMod/src/stopspam.cpp index 2db2d3ef6b..bcb22c885d 100755 --- a/plugins/StopSpamMod/src/stopspam.cpp +++ b/plugins/StopSpamMod/src/stopspam.cpp @@ -23,10 +23,8 @@ MIRANDA_HOOK_EVENT(ME_DB_CONTACT_ADDED, w, l) return 0; } -MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, hContact, lParam) +MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, hContact, hDbEvent) { - HANDLE hDbEvent = (HANDLE)lParam; - DBEVENTINFO dbei = { sizeof(dbei) }; dbei.cbBlob = db_event_getBlobSize(hDbEvent); if (dbei.cbBlob == -1) diff --git a/plugins/StopSpamPlus/src/events.cpp b/plugins/StopSpamPlus/src/events.cpp index 4d828d5c1c..c55e9c09ee 100644 --- a/plugins/StopSpamPlus/src/events.cpp +++ b/plugins/StopSpamPlus/src/events.cpp @@ -2,7 +2,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam)
{
- HANDLE hDbEvent = (HANDLE)lParam;
+ MEVENT hDbEvent = (MEVENT)lParam;
DBEVENTINFO dbei = {0};
dbei.cbSize = sizeof(dbei);
diff --git a/plugins/StopSpamPlus/src/utils.cpp b/plugins/StopSpamPlus/src/utils.cpp index 4f4e1b407d..b8dd8371e5 100644 --- a/plugins/StopSpamPlus/src/utils.cpp +++ b/plugins/StopSpamPlus/src/utils.cpp @@ -14,7 +14,7 @@ tstring &GetDlgItemString(HWND hwnd, int id) bool IsExistMyMessage(MCONTACT hContact)
{
- HANDLE hDbEvent = db_event_first(hContact);
+ MEVENT hDbEvent = db_event_first(hContact);
while(hDbEvent){
DBEVENTINFO dbei = { sizeof(dbei) };
if (db_event_get(hDbEvent, &dbei))
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp index 6599c2859e..9c5e1e72f8 100644 --- a/plugins/TabSRMM/src/chat/services.cpp +++ b/plugins/TabSRMM/src/chat/services.cpp @@ -100,7 +100,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT newData.iActivate = bActivateTab;
pContainer->iChilds++;
newData.bWantPopup = bWantPopup;
- newData.hdbEvent = (HANDLE)si;
+ newData.si = si;
HWND hwndNew = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CHANNEL), GetDlgItem(pContainer->hwnd, 1159), RoomWndProc, (LPARAM)&newData);
if (pContainer->dwFlags & CNT_SIDEBAR) {
TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndNew, GWLP_USERDATA);
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index a67f364f99..f3550e2061 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -1774,10 +1774,9 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case WM_INITDIALOG: { TNewWindowData *newData = (TNewWindowData*)lParam; - si = (SESSION_INFO*)newData->hdbEvent; TWindowData *dat = (TWindowData*)mir_calloc( sizeof(TWindowData)); - dat->si = si; + dat->si = si = newData->si; dat->hContact = si->hContact; dat->szProto = GetContactProto(si->hContact); dat->bType = SESSIONTYPE_CHAT; diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index af53cbdda6..3faa91cc84 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -556,7 +556,7 @@ static TCHAR* GetPreviewT(WORD eventType, DBEVENTINFO* dbe) }
}
-static int PopupUpdateT(MCONTACT hContact, HANDLE hEvent)
+static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent)
{
PLUGIN_DATAT *pdata = const_cast<PLUGIN_DATAT *>(PU_GetByContact(hContact));
if (!pdata)
@@ -627,7 +627,7 @@ static int PopupUpdateT(MCONTACT hContact, HANDLE hEvent) return 0;
}
-static int PopupShowT(NEN_OPTIONS *pluginOptions, MCONTACT hContact, HANDLE hEvent, UINT eventType, HWND hContainer)
+static int PopupShowT(NEN_OPTIONS *pluginOptions, MCONTACT hContact, MEVENT hEvent, UINT eventType, HWND hContainer)
{
//there has to be a maximum number of popups shown at the same time
if (arPopupList.getCount() >= MAX_POPUPS)
@@ -820,7 +820,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro return 0;
}
-int tabSRMM_ShowPopup(MCONTACT hContact, HANDLE hDbEvent, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto)
+int tabSRMM_ShowPopup(MCONTACT hContact, MEVENT hDbEvent, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto)
{
if (nen_options.iDisable) // no popups at all. Period
return 0;
diff --git a/plugins/TabSRMM/src/functions.h b/plugins/TabSRMM/src/functions.h index c09dd21f2e..fa5ae612fc 100644 --- a/plugins/TabSRMM/src/functions.h +++ b/plugins/TabSRMM/src/functions.h @@ -70,7 +70,7 @@ void TSAPI HandleMenuEntryFromhContact(MCONTACT iSelection); BOOL TSAPI IsUtfSendAvailable(MCONTACT hContact);
HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, int isSend,
- const char *pszInitialText, BOOL bActivateTAb, BOOL bPopupContainer, BOOL bWantPopup, HANDLE hdbEvent);
+ const char *pszInitialText, BOOL bActivateTAb, BOOL bPopupContainer, BOOL bWantPopup, MEVENT hdbEvent);
int TSAPI ActivateTabFromHWND(HWND hwndTab, HWND hwnd);
void TSAPI FlashContainer(TContainerData *pContainer, int iMode, int iNum);
void TSAPI CreateImageList(BOOL bInitial);
@@ -123,8 +123,8 @@ int DbEventIsForMsgWindow(DBEVENTINFO *dbei); int TSAPI InitOptions(void);
int TSAPI DbEventIsShown(DBEVENTINFO *dbei);
-void TSAPI StreamInEvents(HWND hwndDlg,HANDLE hDbEventFirst,int count,int fAppend, DBEVENTINFO *dbei_s);
-void TSAPI LoadLogfont(int i,LOGFONTA *lf,COLORREF *colour, char *szModule);
+void TSAPI StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAppend, DBEVENTINFO *dbei_s);
+void TSAPI LoadLogfont(int i, LOGFONTA *lf, COLORREF *colour, char *szModule);
// custom tab control
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index b58e48aeee..7f5280b9b3 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -1560,7 +1560,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam) { TContainerData *m_pContainer = dat->pContainer; HWND hwndDlg = dat->hwnd, hwndContainer = m_pContainer->hwnd, hwndTab = GetParent(dat->hwnd); - HANDLE hDbEvent = (HANDLE)lParam; + MEVENT hDbEvent = (MEVENT)lParam; DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(hDbEvent, &dbei); @@ -1610,10 +1610,10 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam) if (hDbEvent != dat->hDbEventFirst) { if (!(dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED)) - SendMessage(hwndDlg, DM_APPENDTOLOG, lParam, 0); + SendMessage(hwndDlg, DM_APPENDTOLOG, hDbEvent, 0); else { if (dat->iNextQueuedEvent >= dat->iEventQueueSize) { - dat->hQueuedEvents = (HANDLE*)mir_realloc(dat->hQueuedEvents, (dat->iEventQueueSize + 10) * sizeof(HANDLE)); + dat->hQueuedEvents = (MEVENT*)mir_realloc(dat->hQueuedEvents, (dat->iEventQueueSize + 10) * sizeof(MEVENT)); dat->iEventQueueSize += 10; } dat->hQueuedEvents[dat->iNextQueuedEvent++] = hDbEvent; diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index ccc83a7940..0db994d7bb 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -551,7 +551,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void) if (db_get_dw(hContact, "SendLater", "count", 0))
sendLater->addContact(hContact);
- 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) };
db_event_get(hDbEvent, &dbei);
if (!dbei.markedRead() && dbei.eventType == EVENTTYPE_MESSAGE) {
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index 4b21acf3da..d87c22c912 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -428,7 +428,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // sent from the popup to "dismiss" the event. we should do this in the main thread
case DM_REMOVECLISTEVENT:
CallService(MS_CLIST_REMOVEEVENT, wParam, lParam);
- db_event_markRead(wParam, (HANDLE)lParam);
+ db_event_markRead(wParam, lParam);
return 0;
case DM_SETLOCALE:
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index f67a9021c4..bc905e8c68 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -186,8 +186,8 @@ bool CMimAPI::getAeroState() void CMimAPI::InitAPI() { - DWORD dwVer = LOWORD(GetVersion());
- m_winVer = MAKEWORD(HIBYTE(dwVer), LOBYTE(dwVer));
+ DWORD dwVer = LOWORD(GetVersion()); + m_winVer = MAKEWORD(HIBYTE(dwVer), LOBYTE(dwVer)); m_hUxTheme = 0; @@ -313,7 +313,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) if (fShowOnClist) { CLISTEVENT cle = { sizeof(cle) }; cle.hContact = hContact; - cle.hDbEvent = (HANDLE)1; + cle.hDbEvent = 1; cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR; cle.hIcon = PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]; cle.pszService = "SRMsg/TypingMessage"; @@ -393,15 +393,15 @@ int CMimAPI::PrebuildContactMenu(WPARAM hContact, LPARAM) // this handler POSTs the event to the message window procedure - so it is fast and can exit quickly which will // improve the overall responsiveness when receiving messages. -int CMimAPI::DispatchNewEvent(WPARAM hContact, LPARAM lParam) +int CMimAPI::DispatchNewEvent(WPARAM hContact, LPARAM hDbEvent) { if (hContact) { - Utils::sendContactMessage(hContact, HM_DBEVENTADDED, hContact, lParam); + Utils::sendContactMessage(hContact, HM_DBEVENTADDED, hContact, hDbEvent); // we're in meta and an event belongs to a sub - MCONTACT hReal = db_event_getContact(HANDLE(lParam)); + MCONTACT hReal = db_event_getContact(hDbEvent); if (hReal != hContact) - Utils::sendContactMessage(hReal, HM_DBEVENTADDED, hContact, lParam); + Utils::sendContactMessage(hReal, HM_DBEVENTADDED, hContact, hDbEvent); } return 0; } @@ -413,11 +413,10 @@ int CMimAPI::DispatchNewEvent(WPARAM hContact, LPARAM lParam) // // if a session is already created, it just does nothing and DispatchNewEvent() will take care. -int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM lParam) +int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent) { TCHAR szName[CONTAINER_NAMELEN + 1]; - HANDLE hDbEvent = (HANDLE)lParam; DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(hDbEvent, &dbei); diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 36cce39ada..dc187812fd 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -1243,7 +1243,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dat->sendMode |= dat->hContact == 0 ? SMODE_MULTIPLE : 0; dat->sendMode |= M.GetByte(dat->hContact, "no_ack", 0) ? SMODE_NOACK : 0; - dat->hQueuedEvents = (HANDLE*)mir_calloc(sizeof(HANDLE)* EVENT_QUEUE_SIZE); + dat->hQueuedEvents = (MEVENT*)mir_calloc(sizeof(MEVENT)* EVENT_QUEUE_SIZE); dat->iEventQueueSize = EVENT_QUEUE_SIZE; dat->iCurrentQueueError = -1; @@ -1252,7 +1252,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dat->maxHistory = M.GetDword(dat->hContact, "maxhist", M.GetDword("maxhist", 0)); dat->curHistory = 0; if (dat->maxHistory) - dat->hHistoryEvents = (HANDLE*)mir_alloc(dat->maxHistory * sizeof(HANDLE)); + dat->hHistoryEvents = (MEVENT*)mir_alloc(dat->maxHistory * sizeof(MEVENT)); else dat->hHistoryEvents = NULL; @@ -1403,7 +1403,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP EnableSendButton(dat, TRUE); } - for (HANDLE hdbEvent = db_event_last(dat->hContact); hdbEvent; hdbEvent = db_event_prev(dat->hContact, hdbEvent)) { + for (MEVENT hdbEvent = db_event_last(dat->hContact); hdbEvent; hdbEvent = db_event_prev(dat->hContact, hdbEvent)) { DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(hdbEvent, &dbei); if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) { @@ -2321,15 +2321,15 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case DM_APPENDMCEVENT: if (dat->hContact == db_mc_getMeta(wParam) && dat->hDbEventFirst == NULL) { - dat->hDbEventFirst = (HANDLE)lParam; + dat->hDbEventFirst = lParam; SendMessage(dat->hwnd, DM_REMAKELOG, 0, 0); } - else if (dat->hContact == wParam && db_mc_isSub(wParam) && db_event_getContact(HANDLE(lParam)) != wParam) - StreamInEvents(hwndDlg, (HANDLE)lParam, 1, 1, NULL); + else if (dat->hContact == wParam && db_mc_isSub(wParam) && db_event_getContact(lParam) != wParam) + StreamInEvents(hwndDlg, lParam, 1, 1, NULL); return 0; case DM_APPENDTOLOG: - StreamInEvents(hwndDlg, (HANDLE)wParam, 1, 1, NULL); + StreamInEvents(hwndDlg, wParam, 1, 1, NULL); return 0; // replays queued events after the message log has been frozen for a while @@ -2782,7 +2782,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP CHARRANGE sel; SETTEXTEX stx = {ST_SELECTION, 1200}; - HANDLE hDBEvent = 0; + MEVENT hDBEvent = 0; if (dat->hwndIEView || dat->hwndHPP) { // IEView quoting support.. TCHAR *selected = 0, *szQuoted = 0; diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 748e1eda13..5da388058e 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -757,7 +757,7 @@ void TSAPI ShowPicture(TWindowData *dat, BOOL showNewPic) SendMessage(hwndDlg, WM_SIZE, 0, 0);
}
-void TSAPI FlashOnClist(HWND hwndDlg, TWindowData *dat, HANDLE hEvent, DBEVENTINFO *dbei)
+void TSAPI FlashOnClist(HWND hwndDlg, TWindowData *dat, MEVENT hEvent, DBEVENTINFO *dbei)
{
dat->dwTickLastEvent = GetTickCount();
@@ -1179,7 +1179,7 @@ void TSAPI FindFirstEvent(TWindowData *dat) switch (historyMode) {
case LOADHISTORY_COUNT:
int i;
- HANDLE hPrevEvent;
+ MEVENT hPrevEvent;
{
DBEVENTINFO dbei = { sizeof(dbei) };
// ability to load only current session's history
@@ -1213,7 +1213,7 @@ void TSAPI FindFirstEvent(TWindowData *dat) DWORD firstTime = dbei.timestamp - 60 * db_get_w(NULL, SRMSGMOD, SRMSGSET_LOADTIME, SRMSGDEFSET_LOADTIME);
for (;;) {
- HANDLE hPrevEvent;
+ MEVENT hPrevEvent;
if (dat->hDbEventFirst == NULL)
hPrevEvent = db_event_last(dat->hContact);
else
diff --git a/plugins/TabSRMM/src/msgdlgutils.h b/plugins/TabSRMM/src/msgdlgutils.h index ff0bdfd815..4eb5d25a82 100644 --- a/plugins/TabSRMM/src/msgdlgutils.h +++ b/plugins/TabSRMM/src/msgdlgutils.h @@ -43,7 +43,7 @@ void TSAPI UpdateReadChars(const TWindowData *dat); void TSAPI ShowPicture(TWindowData *dat, BOOL showNewPic);
void TSAPI AdjustBottomAvatarDisplay(TWindowData *dat);
void TSAPI SetDialogToType(HWND hwndDlg);
-void TSAPI FlashOnClist(HWND hwndDlg, TWindowData *dat, HANDLE hEvent, DBEVENTINFO *dbei);
+void TSAPI FlashOnClist(HWND hwndDlg, TWindowData *dat, MEVENT hEvent, DBEVENTINFO *dbei);
char* TSAPI Message_GetFromStream(HWND hwndDlg, const TWindowData *dat, DWORD dwPassedFlags);
BOOL TSAPI DoRtfToTags(TCHAR * pszText, const TWindowData *dat);
void TSAPI GetMYUIN(TWindowData *dat);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index c8ef054993..098ea3c312 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -87,7 +87,7 @@ static HICON Logicons[NR_LOGICONS]; struct LogStreamData {
int stage;
MCONTACT hContact;
- HANDLE hDbEvent, hDbEventLast;
+ MEVENT hDbEvent, hDbEventLast;
char *buffer;
int bufferOffset, bufferLen;
int eventsToInsert;
@@ -443,7 +443,7 @@ int DbEventIsForMsgWindow(DBEVENTINFO *dbei) return et && (et->flags & DETF_MSGWINDOW);
}
-static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, HANDLE hDbEvent, LogStreamData *streamData)
+static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, MEVENT hDbEvent, LogStreamData *streamData)
{
HANDLE hTimeZone = NULL;
BOOL skipToNext = FALSE, skipFont = FALSE;
@@ -1201,7 +1201,7 @@ static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppe }
}
-void TSAPI StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAppend, DBEVENTINFO *dbei_s)
+void TSAPI StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAppend, DBEVENTINFO *dbei_s)
{
TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
CHARRANGE oldSel, sel;
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 56522f86fe..68a99e98e3 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -447,7 +447,7 @@ int TSAPI ActivateExistingTab(TContainerData *pContainer, HWND hwndChild) // bActivateTab: make the new tab the active one // bPopupContainer: restore container if it was minimized, otherwise flash it... -HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, int isSend, const char *pszInitialText, BOOL bActivateTab, BOOL bPopupContainer, BOOL bWantPopup, HANDLE hdbEvent) +HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, int isSend, const char *pszInitialText, BOOL bActivateTab, BOOL bPopupContainer, BOOL bWantPopup, MEVENT hdbEvent) { if (M.FindWindow(hContact) != 0) { _DebugPopup(hContact, _T("Warning: trying to create duplicate window")); diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index a4db3ef8b4..116198c758 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -260,7 +260,7 @@ struct TWindowData SESSION_INFO *si;
RECT rcNick, rcUIN, rcStatus, rcPic;
- HANDLE hDbEventFirst, hDbEventLast;
+ MEVENT hDbEventFirst, hDbEventLast;
int sendMode;
int splitterY, originalSplitterY, dynaSplitter, savedSplitter, savedSplitY, savedDynaSplit;
int multiSplitterX;
@@ -287,10 +287,10 @@ struct TWindowData DWORD dwLastActivity;
int iOpenJobs;
int iCurrentQueueError;
- HANDLE hFlashingEvent;
+ MEVENT hFlashingEvent;
TCHAR myUin[80];
int SendFormat;
- HANDLE *hQueuedEvents;
+ MEVENT *hQueuedEvents;
int iNextQueuedEvent;
#define EVENT_QUEUE_SIZE 10
int iEventQueueSize;
@@ -304,7 +304,7 @@ struct TWindowData DWORD panelStatusCX;
COLORREF inputbg;
avatarCacheEntry *ace, *ownAce;
- HANDLE *hHistoryEvents;
+ MEVENT *hHistoryEvents;
int maxHistory, curHistory;
HANDLE hTheme, hThemeIP, hThemeToolbar;
char szMicroLf[128];
@@ -417,9 +417,12 @@ struct TNewWindowData int iActivate;
TCITEM item;
BOOL bWantPopup;
- HANDLE hdbEvent;
HKL hkl;
+ union {
+ MEVENT hdbEvent;
+ SESSION_INFO *si;
+ };
TContainerData *pContainer;
};
diff --git a/plugins/TabSRMM/src/nen.h b/plugins/TabSRMM/src/nen.h index e86c57a610..72ab2ef763 100644 --- a/plugins/TabSRMM/src/nen.h +++ b/plugins/TabSRMM/src/nen.h @@ -39,7 +39,7 @@ #define MODULE "tabSRMM_NEN"
-int tabSRMM_ShowPopup(MCONTACT hContact, HANDLE hDbEvent, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto);
+int tabSRMM_ShowPopup(MCONTACT hContact, MEVENT hDbEvent, WORD eventType, int windowOpen, TContainerData *pContainer, HWND hwndChild, const char *szProto);
#define DEFAULT_COLBACK RGB(255,255,128)
#define DEFAULT_COLTEXT RGB(0,0,0)
@@ -132,7 +132,7 @@ struct NEN_OPTIONS struct EVENT_DATAT
{
- HANDLE hEvent;
+ MEVENT hEvent;
TCHAR tszText[MAX_SECONDLINE + 2];
DWORD timestamp;
};
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index c3b3b6480d..c4a6da240b 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -712,7 +712,7 @@ inform_and_discard: NotifyEventHooks(PluginConfig.m_event_WriteEvent, 0, (LPARAM)&evt); job.szSendBuffer = (char*)dbei.pBlob; - HANDLE hNewEvent = db_event_add(job.hContact, &dbei); + MEVENT hNewEvent = db_event_add(job.hContact, &dbei); if (m_pContainer) if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND)) diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 97559c11da..4bf6c42d4c 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -121,7 +121,7 @@ void StripBBCodesInPlace(TCHAR *swzText) DWORD LastMessageTimestamp(MCONTACT hContact, bool received) { - for (HANDLE hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) { + for (MEVENT hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) { DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(hDbEvent, &dbei); if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT) == received) @@ -168,7 +168,7 @@ bool UidName(char *szProto, TCHAR *buff, int bufflen) TCHAR *GetLastMessageText(MCONTACT hContact, bool received) { - for (HANDLE hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) { + for (MEVENT hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) { DBEVENTINFO dbei = { sizeof(dbei) }; db_event_get(hDbEvent, &dbei); if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT) == received) { @@ -383,7 +383,7 @@ bool GetSysSubstText(MCONTACT hContact, TCHAR *swzRawSpec, TCHAR *buff, int buff dwNewTs = dwLastTs; - HANDLE dbe = db_event_last(hTmpContact); + MEVENT dbe = db_event_last(hTmpContact); while (dbe != NULL) { DBEVENTINFO dbei = { sizeof(dbei) }; if (!db_event_get(dbe, &dbei)) { diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp index 9259bb827d..ca273e1f13 100644 --- a/plugins/TipperYM/src/tipper.cpp +++ b/plugins/TipperYM/src/tipper.cpp @@ -109,7 +109,7 @@ int SettingChanged(WPARAM hContact, LPARAM lParam) int EventDeleted(WPARAM wParam, LPARAM lParam)
{
DBEVENTINFO dbei = { sizeof(dbei) };
- if (!db_event_get((HANDLE)lParam, &dbei))
+ if (!db_event_get(lParam, &dbei))
if (dbei.eventType == EVENTTYPE_MESSAGE)
db_unset(wParam, MODULE, "LastCountTS");
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index c33bc8aaf8..0e409bc24a 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -401,7 +401,7 @@ BYTE CExImContactXML::ExportEvents() DWORD cbEventBuf = 0, dwNumEventsAdded = 0;
// read out all events for the current contact
- for (HANDLE hDbEvent = db_event_first(_hContact); hDbEvent != NULL; hDbEvent = db_event_next(_hContact, hDbEvent)) {
+ for (MEVENT hDbEvent = db_event_first(_hContact); hDbEvent != NULL; hDbEvent = db_event_next(_hContact, hDbEvent)) {
DBEVENTINFO dbei = { sizeof(DBEVENTINFO) };
if (DB::Event::GetInfoWithData(hDbEvent, &dbei))
continue;
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.h b/plugins/UserInfoEx/src/ex_import/classExImContactXML.h index b88d1b8097..e989484072 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.h +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.h @@ -47,9 +47,9 @@ enum EError { class CExImContactXML : public CExImContactBase {
- CFileXml* _pXmlFile; // the xmlfile
- TiXmlElement* _xmlNode; // xmlnode with contact information
- HANDLE _hEvent;
+ CFileXml *_pXmlFile; // the xmlfile
+ TiXmlElement *_xmlNode; // xmlnode with contact information
+ MEVENT _hEvent;
BYTE IsContactInfo(LPCSTR pszKey);
diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp index c55a2f4a43..972e9790ba 100644 --- a/plugins/UserInfoEx/src/mir_db.cpp +++ b/plugins/UserInfoEx/src/mir_db.cpp @@ -80,7 +80,7 @@ BYTE Delete(MCONTACT hContact) DWORD WhenAdded(DWORD dwUIN, LPCSTR pszProto)
{
DBEVENTINFO dbei = { sizeof(dbei) };
- for (HANDLE edbe = db_event_first(NULL); edbe != NULL; edbe = db_event_next(NULL, edbe)) {
+ for (MEVENT edbe = db_event_first(NULL); edbe != NULL; edbe = db_event_next(NULL, edbe)) {
// get eventtype and compare
if (!DB::Event::GetInfo(edbe, &dbei) && dbei.eventType == EVENTTYPE_ADDED) {
if (!DB::Event::GetInfoWithData(edbe, &dbei)) {
@@ -553,7 +553,7 @@ namespace Event { * @retval nonezero - failure
**/
-bool GetInfo(HANDLE hEvent, DBEVENTINFO *dbei)
+bool GetInfo(MEVENT hEvent, DBEVENTINFO *dbei)
{
dbei->cbSize = sizeof(DBEVENTINFO);
dbei->cbBlob = 0;
@@ -571,7 +571,7 @@ bool GetInfo(HANDLE hEvent, DBEVENTINFO *dbei) * @retval 1 - failure
**/
-bool GetInfoWithData(HANDLE hEvent, DBEVENTINFO *dbei)
+bool GetInfoWithData(MEVENT hEvent, DBEVENTINFO *dbei)
{
dbei->cbSize = sizeof(DBEVENTINFO);
if (!dbei->cbBlob) {
@@ -601,7 +601,7 @@ bool GetInfoWithData(HANDLE hEvent, DBEVENTINFO *dbei) * @retval timestamp
**/
-DWORD TimeOf(HANDLE hEvent)
+DWORD TimeOf(MEVENT hEvent)
{
DBEVENTINFO dbei;
if (!GetInfo(hEvent, &dbei))
@@ -648,7 +648,7 @@ static FORCEINLINE bool IsEqual(const DBEVENTINFO *d1, const DBEVENTINFO *d2, bo *
**/
-bool Exists(MCONTACT hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei)
+bool Exists(MCONTACT hContact, MEVENT& hDbExistingEvent, DBEVENTINFO *dbei)
{
bool result = false;
DBEVENTINFO edbei;
@@ -670,7 +670,7 @@ bool Exists(MCONTACT hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei) }
}
}
- HANDLE edbe = db_event_last(hContact);
+ MEVENT edbe = db_event_last(hContact);
if (edbe == hDbExistingEvent)
return FALSE;
@@ -678,8 +678,8 @@ bool Exists(MCONTACT hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei) }
}
if (hDbExistingEvent) {
- HANDLE sdbe = hDbExistingEvent;
- for (HANDLE edbe = sdbe; edbe && !GetInfo(edbe, &edbei) && (dbei->timestamp <= edbei.timestamp); edbe = db_event_prev(hContact, edbe)) {
+ MEVENT sdbe = hDbExistingEvent;
+ for (MEVENT edbe = sdbe; edbe && !GetInfo(edbe, &edbei) && (dbei->timestamp <= edbei.timestamp); edbe = db_event_prev(hContact, edbe)) {
hDbExistingEvent = edbe;
//compare without data (faster)
if ( result = IsEqual(dbei, &edbei, false)) {
@@ -695,7 +695,7 @@ bool Exists(MCONTACT hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei) } /*end for*/
if (!result) {
- for (HANDLE edbe = db_event_next(hContact, sdbe); edbe && !GetInfo(edbe, &edbei) && (dbei->timestamp >= edbei.timestamp); edbe = db_event_next(hContact, edbe)) {
+ for (MEVENT edbe = db_event_next(hContact, sdbe); edbe && !GetInfo(edbe, &edbei) && (dbei->timestamp >= edbei.timestamp); edbe = db_event_next(hContact, edbe)) {
hDbExistingEvent = edbe;
//compare without data (faster)
if (result = IsEqual(dbei, &edbei, false)) {
diff --git a/plugins/UserInfoEx/src/mir_db.h b/plugins/UserInfoEx/src/mir_db.h index a11d01dca1..adb8ef8927 100644 --- a/plugins/UserInfoEx/src/mir_db.h +++ b/plugins/UserInfoEx/src/mir_db.h @@ -110,10 +110,10 @@ namespace Variant { namespace Event {
HANDLE FindLast(MCONTACT hContact);
- bool GetInfo(HANDLE hEvent, DBEVENTINFO *dbei);
- bool GetInfoWithData(HANDLE hEvent, DBEVENTINFO *dbei);
- DWORD GetTime(HANDLE hEvent);
- bool Exists(MCONTACT hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei);
+ bool GetInfo(MEVENT hEvent, DBEVENTINFO *dbei);
+ bool GetInfoWithData(MEVENT hEvent, DBEVENTINFO *dbei);
+ DWORD GetTime(MEVENT hEvent);
+ bool Exists(MCONTACT hContact, MEVENT& hDbExistingEvent, DBEVENTINFO *dbei);
} /* namespace Events */
/**
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index 01b7581969..d736147d23 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -500,7 +500,7 @@ static BOOL isValidDbEvent(DBEVENTINFO *dbe, int flags) return (bEventType && bEventFlags);
}
-static HANDLE findDbEvent(MCONTACT hContact, HANDLE hDbEvent, int flags)
+static MEVENT findDbEvent(MCONTACT hContact, MEVENT hDbEvent, int flags)
{
DBEVENTINFO dbe;
BOOL bEventOk;
@@ -526,7 +526,7 @@ static HANDLE findDbEvent(MCONTACT hContact, HANDLE hDbEvent, int flags) hDbEvent = db_event_prev(hContact, hDbEvent);
}
else {
- HANDLE hMatchEvent, hSearchEvent;
+ MEVENT hMatchEvent, hSearchEvent;
DWORD matchTimestamp, priorTimestamp;
hMatchEvent = hSearchEvent = NULL;
@@ -664,7 +664,7 @@ static TCHAR* parseDbEvent(ARGUMENTSINFO *ai) else if (ci.hContacts != NULL)
mir_free(ci.hContacts);
- HANDLE hDbEvent = findDbEvent(hContact, NULL, flags);
+ MEVENT hDbEvent = findDbEvent(hContact, NULL, flags);
if (hDbEvent == NULL)
return NULL;
diff --git a/plugins/WinterSpeak/src/EventInformation.cpp b/plugins/WinterSpeak/src/EventInformation.cpp index 21c90a7b85..f79c03eb0e 100644 --- a/plugins/WinterSpeak/src/EventInformation.cpp +++ b/plugins/WinterSpeak/src/EventInformation.cpp @@ -23,7 +23,7 @@ EventInformation::~EventInformation() }
//------------------------------------------------------------------------------
-bool EventInformation::isValidEvent(HANDLE event)
+bool EventInformation::isValidEvent(MEVENT event)
{
// clean up the old event
if (m_event_info.pBlob)
diff --git a/plugins/WinterSpeak/src/EventInformation.h b/plugins/WinterSpeak/src/EventInformation.h index 42169d21e9..7ef1d698af 100644 --- a/plugins/WinterSpeak/src/EventInformation.h +++ b/plugins/WinterSpeak/src/EventInformation.h @@ -13,7 +13,7 @@ class EventInformation // Description : is the event valid?
// Return : true = the event is valid
//--------------------------------------------------------------------------
- bool isValidEvent(HANDLE event);
+ bool isValidEvent(MEVENT event);
//--------------------------------------------------------------------------
// Description : get the last event received
@@ -49,5 +49,5 @@ class EventInformation private:
std::map<unsigned short, std::wstring> m_event_strings;
- DBEVENTINFO m_event_info;
+ DBEVENTINFO m_event_info;
};
diff --git a/plugins/WinterSpeak/src/SpeakAnnounce.cpp b/plugins/WinterSpeak/src/SpeakAnnounce.cpp index c7f87b26e8..29407e6fb2 100644 --- a/plugins/WinterSpeak/src/SpeakAnnounce.cpp +++ b/plugins/WinterSpeak/src/SpeakAnnounce.cpp @@ -66,7 +66,7 @@ void SpeakAnnounce::statusChange(DBCONTACTWRITESETTING *write_setting, MCONTACT }
//------------------------------------------------------------------------------
-void SpeakAnnounce::incomingEvent(MCONTACT user, HANDLE event)
+void SpeakAnnounce::incomingEvent(MCONTACT user, MEVENT event)
{
if (!m_event_info.isValidEvent(event))
return;
diff --git a/plugins/WinterSpeak/src/SpeakAnnounce.h b/plugins/WinterSpeak/src/SpeakAnnounce.h index c49223b86a..763f36cce8 100644 --- a/plugins/WinterSpeak/src/SpeakAnnounce.h +++ b/plugins/WinterSpeak/src/SpeakAnnounce.h @@ -17,7 +17,7 @@ public: //--------------------------------------------------------------------------
// Description : handle an event
//--------------------------------------------------------------------------
- void incomingEvent(MCONTACT user, HANDLE event);
+ void incomingEvent(MCONTACT user, MEVENT event);
//--------------------------------------------------------------------------
// Description : handle a protocol state change
diff --git a/plugins/WinterSpeak/src/main.cpp b/plugins/WinterSpeak/src/main.cpp index d6c7d9bbcc..47a432fdc5 100644 --- a/plugins/WinterSpeak/src/main.cpp +++ b/plugins/WinterSpeak/src/main.cpp @@ -53,7 +53,7 @@ int eventStatusChange(WPARAM wParam, LPARAM lParam) //-----------------------------------------------------------------------------
int eventMessageAdded(WPARAM wParam, LPARAM lParam)
{
- g_speak_announce->incomingEvent(MCONTACT(wParam), reinterpret_cast<HANDLE>(lParam));
+ g_speak_announce->incomingEvent(wParam, lParam);
return 0;
}
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index d8334bb002..51fb53124e 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -100,7 +100,7 @@ static int ProtoAck(WPARAM, LPARAM lParam) /////////////////////////////////////////////////////////////////////////////////////////
-static bool isReceiveMessage(HANDLE hDbEvent)
+static bool isReceiveMessage(MEVENT hDbEvent)
{
DBEVENTINFO info = { sizeof(info) };
db_event_get(hDbEvent, &info);
@@ -111,7 +111,7 @@ static bool isReceiveMessage(HANDLE hDbEvent) static int ProcessEvent(WPARAM hContact, LPARAM lParam)
{
- if (!isReceiveMessage(HANDLE(lParam)))
+ if (!isReceiveMessage(lParam))
return 0;
isIgnoreSound = db_get_b(hContact, SETTINGSNAME, SETTINGSIGNOREKEY, 0);
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index 09e51d0d12..644ee20222 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -660,8 +660,8 @@ void DoMailActions(HWND hDlg,HACCOUNT ActualAccount,struct CMailNumbers *MN,DWOR cEvent.cbSize = sizeof(CLISTEVENT); cEvent.hContact = ActualAccount->hContact; cEvent.hIcon = g_LoadIconEx(2); - cEvent.hDbEvent = (HANDLE)ActualAccount->hContact; - cEvent.lParam = (LPARAM) ActualAccount->hContact; + cEvent.hDbEvent = ActualAccount->hContact; + cEvent.lParam = ActualAccount->hContact; cEvent.pszService = MS_YAMN_CLISTDBLCLICK; cEvent.pszTooltip = sMsg; cEvent.flags = 0; diff --git a/plugins/YARelay/src/main.cpp b/plugins/YARelay/src/main.cpp index eac2d93b3f..668b5adf65 100644 --- a/plugins/YARelay/src/main.cpp +++ b/plugins/YARelay/src/main.cpp @@ -87,11 +87,8 @@ int ProtoAck(WPARAM wparam,LPARAM lparam) /**
* New event was added into DB.
*/
-static int MessageEventAdded(WPARAM wParam, LPARAM lParam)
+static int MessageEventAdded(WPARAM hContact, LPARAM hDBEvent)
{
- MCONTACT hContact = wParam;
- HANDLE hDBEvent = (HANDLE)lParam;
-
// is the message sender accepted for forwarding
if (hForwardFrom != 0 && hForwardFrom != hContact)
return 0;
diff --git a/plugins/wbOSD/src/events.cpp b/plugins/wbOSD/src/events.cpp index c985e8adf2..b9b287e37f 100644 --- a/plugins/wbOSD/src/events.cpp +++ b/plugins/wbOSD/src/events.cpp @@ -127,10 +127,9 @@ int ContactStatusChanged(WPARAM wParam, LPARAM lParam) return 0;
}
-int HookedNewEvent(WPARAM wParam, LPARAM lParam)
+int HookedNewEvent(WPARAM wParam, LPARAM hDBEvent)
{
logmsg("HookedNewEvent1");
- HANDLE hDBEvent = (HANDLE) lParam;
DBEVENTINFO dbe;
dbe.cbSize = sizeof(dbe);
dbe.cbBlob = db_event_getBlobSize(hDBEvent);
|