diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/stdfile/file.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 8 | ||||
-rw-r--r-- | src/core/stdmsg/src/msglog.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgs.cpp | 12 | ||||
-rw-r--r-- | src/core/stduihist/history.cpp | 2 | ||||
-rw-r--r-- | src/core/stdurl/url.cpp | 2 |
6 files changed, 12 insertions, 16 deletions
diff --git a/src/core/stdfile/file.cpp b/src/core/stdfile/file.cpp index 3252ed5e5c..e7d92eb921 100644 --- a/src/core/stdfile/file.cpp +++ b/src/core/stdfile/file.cpp @@ -295,7 +295,7 @@ static void RemoveUnreadFileEvents(void) db_event_get(hDbEvent, &dbei);
if (!(dbei.flags&(DBEF_SENT | DBEF_READ)) && dbei.eventType == EVENTTYPE_FILE)
db_event_markRead(hContact, hDbEvent);
- hDbEvent = db_event_next(hDbEvent);
+ hDbEvent = db_event_next(hContact, hDbEvent);
}
}
}
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 67f5f02a8e..1daa199bf7 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -780,7 +780,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (dat->hDbEventFirst == NULL)
hPrevEvent = db_event_last(dat->hContact);
else
- hPrevEvent = db_event_prev(dat->hDbEventFirst);
+ hPrevEvent = db_event_prev(dat->hContact, dat->hDbEventFirst);
if (hPrevEvent == NULL)
break;
@@ -806,7 +806,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (dat->hDbEventFirst == NULL)
hPrevEvent = db_event_last(dat->hContact);
else
- hPrevEvent = db_event_prev(dat->hDbEventFirst);
+ hPrevEvent = db_event_prev(dat->hContact, dat->hDbEventFirst);
if (hPrevEvent == NULL)
break;
@@ -831,7 +831,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP break;
}
}
- while (hdbEvent = db_event_prev(hdbEvent));
+ while (hdbEvent = db_event_prev(dat->hContact, hdbEvent));
}
SendMessage(hwndDlg, DM_OPTIONSAPPLIED, 1, 0);
@@ -1326,7 +1326,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP dat->lastMessage = dbei.timestamp;
SendMessage(hwndDlg, DM_UPDATELASTMESSAGE, 0, 0);
}
- if (hDbEvent != dat->hDbEventFirst && db_event_next(hDbEvent) == NULL)
+ if (hDbEvent != dat->hDbEventFirst && db_event_next(dat->hContact, hDbEvent) == NULL)
SendMessage(hwndDlg, DM_APPENDTOLOG, lParam, 0);
else
SendMessage(hwndDlg, DM_REMAKELOG, 0, 0);
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index c0307ea826..866b808102 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -471,7 +471,7 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG dat->buffer = CreateRTFFromDbEvent(dat->dlgDat, dat->hContact, dat->hDbEvent, dat);
if (dat->buffer)
dat->hDbEventLast = dat->hDbEvent;
- dat->hDbEvent = db_event_next(dat->hDbEvent);
+ dat->hDbEvent = db_event_next(dat->hContact, dat->hDbEvent);
if (--dat->eventsToInsert == 0)
break;
} while (dat->buffer == NULL && dat->hDbEvent);
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index f164d72b31..f240323924 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -223,8 +223,6 @@ static int ContactDeleted(WPARAM wParam, LPARAM lParam) static void RestoreUnreadMessageAlerts(void)
{
TCHAR toolTip[256];
- int windowAlreadyExists;
- int autoPopup;
CLISTEVENT cle = { sizeof(cle) };
cle.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
@@ -235,19 +233,18 @@ static void RestoreUnreadMessageAlerts(void) DBEVENTINFO dbei = { sizeof(dbei) };
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- HANDLE hDbEvent = db_event_firstUnread(hContact);
- while (hDbEvent) {
- autoPopup = 0;
+ for (HANDLE hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
+ bool autoPopup = false;
dbei.cbBlob = 0;
db_event_get( hDbEvent, &dbei);
if (!(dbei.flags & (DBEF_SENT | DBEF_READ)) && ( dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei))) {
- windowAlreadyExists = WindowList_Find(g_dat.hMessageWindowList, hContact) != NULL;
+ int windowAlreadyExists = WindowList_Find(g_dat.hMessageWindowList, hContact) != NULL;
if (windowAlreadyExists)
continue;
char *szProto = GetContactProto(hContact);
if (szProto && (g_dat.openFlags & SRMMStatusToPf2(CallProtoService(szProto, PS_GETSTATUS, 0, 0))))
- autoPopup = 1;
+ autoPopup = true;
if (autoPopup && !windowAlreadyExists) {
NewMessageWindowLParam newData = {0};
@@ -262,7 +259,6 @@ static void RestoreUnreadMessageAlerts(void) CallService(MS_CLIST_ADDEVENT, 0, (LPARAM) & cle);
}
}
- hDbEvent = db_event_next(hDbEvent);
}
}
}
diff --git a/src/core/stduihist/history.cpp b/src/core/stduihist/history.cpp index af51a6e95d..cc356ec781 100644 --- a/src/core/stduihist/history.cpp +++ b/src/core/stduihist/history.cpp @@ -168,7 +168,7 @@ static void FillHistoryThread(void* param) i = SendMessage(hwndList, LB_ADDSTRING, 0, (LPARAM)eventText);
SendMessage(hwndList, LB_SETITEMDATA, i, (LPARAM)hDbEvent);
}
- hDbEvent = db_event_prev(hDbEvent);
+ hDbEvent = db_event_prev(hInfo->hContact, hDbEvent);
}
mir_free(dbei.pBlob);
diff --git a/src/core/stdurl/url.cpp b/src/core/stdurl/url.cpp index 763fb637bd..40cb58fcda 100644 --- a/src/core/stdurl/url.cpp +++ b/src/core/stdurl/url.cpp @@ -89,7 +89,7 @@ static void RestoreUnreadUrlAlerts(void) cle.ptszTooltip = toolTip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
- hDbEvent = db_event_next(hDbEvent);
+ hDbEvent = db_event_next(hContact, hDbEvent);
}
}
}
|