diff options
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/clist/clcitems.cpp | 8 | ||||
-rw-r--r-- | src/modules/clist/clistmod.cpp | 8 | ||||
-rw-r--r-- | src/modules/clist/contact.cpp | 4 | ||||
-rw-r--r-- | src/modules/clist/groups.cpp | 8 | ||||
-rw-r--r-- | src/modules/ignore/ignore.cpp | 8 | ||||
-rw-r--r-- | src/modules/protocols/protoaccs.cpp | 4 | ||||
-rw-r--r-- | src/modules/visibility/visibility.cpp | 8 |
7 files changed, 24 insertions, 24 deletions
diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp index 4ef4118104..0b343f19ca 100644 --- a/src/modules/clist/clcitems.cpp +++ b/src/modules/clist/clcitems.cpp @@ -106,13 +106,13 @@ struct ClcGroup* fnAddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, group->totalMembers = 0;
if (flags != (DWORD) - 1 && pNextField == NULL && calcTotalMembers) {
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact) {
ClcCacheEntryBase* cache = cli.pfnGetCacheEntry(hContact);
if ( !lstrcmp(cache->tszGroup, szName) && (style & CLS_SHOWHIDDEN || !cache->bIsHidden))
group->totalMembers++;
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
}
}
@@ -381,7 +381,7 @@ void fnRebuildEntireList(HWND hwnd, struct ClcData *dat) }
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact) {
if (style & CLS_SHOWHIDDEN || !db_get_b(hContact, "CList", "Hidden", 0)) {
if (DBGetContactSettingTString(hContact, "CList", "Group", &dbv))
@@ -414,7 +414,7 @@ void fnRebuildEntireList(HWND hwnd, struct ClcData *dat) else cli.pfnAddContactToGroup(dat, group, hContact);
}
}
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
if (style & CLS_HIDEEMPTYGROUPS) {
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp index 2f1cbfbfd0..2bc691ca94 100644 --- a/src/modules/clist/clistmod.cpp +++ b/src/modules/clist/clistmod.cpp @@ -146,13 +146,13 @@ static int ProtocolAck(WPARAM, LPARAM lParam) if ((int) ack->hProcess < ID_STATUS_ONLINE && ack->lParam >= ID_STATUS_ONLINE) {
DWORD caps = (DWORD)CallProtoServiceInt(NULL,ack->szModule, PS_GETCAPS, PFLAGNUM_1, 0);
if (caps & PF1_SERVERCLIST) {
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact) {
char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
if (szProto != NULL && !strcmp(szProto, ack->szModule))
if (db_get_b(hContact, "CList", "Delete", 0))
CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
}
}
@@ -552,9 +552,9 @@ void UnloadContactListModule() return;
//remove transitory contacts
- HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != NULL) {
- HANDLE hNext = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ HANDLE hNext = db_find_next(hContact);
if (db_get_b(hContact, "CList", "NotOnList", 0))
CallService(MS_DB_CONTACT_DELETE, (WPARAM) hContact, 0);
hContact = hNext;
diff --git a/src/modules/clist/contact.cpp b/src/modules/clist/contact.cpp index 932efb03fc..dd5afb8094 100644 --- a/src/modules/clist/contact.cpp +++ b/src/modules/clist/contact.cpp @@ -79,12 +79,12 @@ void fnLoadContactTree(void) }
hideOffline = db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while (hContact != NULL) {
status = GetContactStatus(hContact);
if (( !hideOffline || status != ID_STATUS_OFFLINE) && !db_get_b(hContact, "CList", "Hidden", 0))
cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode((char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0), status, hContact), 1);
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ hContact = db_find_next(hContact);
}
sortByStatus = db_get_b(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT);
sortByProto = db_get_b(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT);
diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp index 931a06d36e..1cfc8b7a9d 100644 --- a/src/modules/clist/groups.cpp +++ b/src/modules/clist/groups.cpp @@ -183,9 +183,9 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) CLISTGROUPCHANGE grpChg = { sizeof(CLISTGROUPCHANGE), NULL, NULL };
- for (hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ for (hContact = db_find_first();
hContact;
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0))
+ hContact = db_find_next(hContact))
{
if (DBGetContactSettingTString(hContact, "CList", "Group", &dbv))
continue;
@@ -273,7 +273,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) DBWriteContactSettingTString(NULL, "CListGroups", idstr, str);
//must rename setting in all child contacts too
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
do {
ClcCacheEntryBase* cache = cli.pfnGetCacheEntry(hContact);
if ( !lstrcmp(cache->tszGroup, oldName)) {
@@ -283,7 +283,7 @@ static int RenameGroupWithMove(int groupId, const TCHAR *szName, int move) cli.pfnCheckCacheItem(cache);
}
}
- while ((hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0)) != NULL);
+ while ((hContact = db_find_next(hContact)) != NULL);
//rename subgroups
{
diff --git a/src/modules/ignore/ignore.cpp b/src/modules/ignore/ignore.cpp index 2b5176394d..715c7897da 100644 --- a/src/modules/ignore/ignore.cpp +++ b/src/modules/ignore/ignore.cpp @@ -166,7 +166,7 @@ static void SaveItemMask(HWND hwndList, HANDLE hContact, HANDLE hItem, const cha static void SetAllContactIcons(HWND hwndList)
{
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
do {
HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem && SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(IGNOREEVENT_MAX, 0)) == 0xFF) {
@@ -182,7 +182,7 @@ static void SetAllContactIcons(HWND hwndList) SendMessage(hwndList, CLM_SETCHECKMARK, (WPARAM)hItem, 1);
}
}
- while (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
+ while (hContact = db_find_next(hContact));
}
static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
@@ -302,7 +302,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
{
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
do {
HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) SaveItemMask( GetDlgItem(hwndDlg, IDC_LIST), hContact, hItem, "Mask1");
@@ -311,7 +311,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM else
DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
}
- while (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
+ while (hContact = db_find_next(hContact));
SaveItemMask( GetDlgItem(hwndDlg, IDC_LIST), NULL, hItemAll, "Default1");
SaveItemMask( GetDlgItem(hwndDlg, IDC_LIST), NULL, hItemUnknown, "Mask1");
}
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp index eef0ef61a4..2f0a4d29c5 100644 --- a/src/modules/protocols/protoaccs.cpp +++ b/src/modules/protocols/protoaccs.cpp @@ -555,10 +555,10 @@ void EraseAccount(const char* pszModuleName) dbcgs.szSetting = "p";
// remove protocol contacts first
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != NULL) {
HANDLE h1 = hContact;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)h1, 0);
+ hContact = db_find_next(h1);
dbv.type = DBVT_ASCIIZ;
dbv.pszVal = szProtoName;
diff --git a/src/modules/visibility/visibility.cpp b/src/modules/visibility/visibility.cpp index 751a02d3cc..9a09bc9bed 100644 --- a/src/modules/visibility/visibility.cpp +++ b/src/modules/visibility/visibility.cpp @@ -104,7 +104,7 @@ static void SetAllContactIcons(HWND hwndList) DWORD flags;
WORD status;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
do {
hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) {
@@ -123,7 +123,7 @@ static void SetAllContactIcons(HWND hwndList) SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(1, status == ID_STATUS_OFFLINE?2:0));
}
}
- } while (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
+ } while (hContact = db_find_next(hContact));
}
static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
@@ -242,7 +242,7 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP { HANDLE hContact, hItem;
int set, i, iImage;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
do {
hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem) {
@@ -257,7 +257,7 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP }
if ( !set) CallContactService(hContact, PSS_SETAPPARENTMODE, 0, 0);
}
- } while (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0));
+ } while (hContact = db_find_next(hContact));
return TRUE;
}
}
|