summaryrefslogtreecommitdiff
path: root/plugins/Sessions
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Sessions')
-rw-r--r--plugins/Sessions/Src/Main.cpp24
-rw-r--r--plugins/Sessions/Src/Options.cpp16
2 files changed, 20 insertions, 20 deletions
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp
index 23636235ae..2aaa3384fb 100644
--- a/plugins/Sessions/Src/Main.cpp
+++ b/plugins/Sessions/Src/Main.cpp
@@ -226,8 +226,8 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lpar
szUserSessionName[lenght+1]='\0';
if(IsDlgButtonChecked(hdlg,IDC_SELCONTACTS)&&bSC)
{
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- for (i=0; hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ HANDLE hContact = db_find_first();
+ for (i=0; hContact; hContact = db_find_next(hContact))
{
BYTE res =(BYTE)SendMessage(hClistControl, CLM_GETCHECKMARK, SendMessage(hClistControl, CLM_FINDCONTACT, (WPARAM)hContact, 0), 0);
if (res)
@@ -471,8 +471,8 @@ int SaveSessionHandles(WPARAM wparam,LPARAM lparam)
if(session_list[0]!=0)
{
- for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (HANDLE hContact = db_find_first(); hContact;
+ hContact = db_find_next(hContact))
{
if ((k=CheckForDuplicate(session_list,(DWORD)hContact))!=-1
&&!(g_bExclHidden&&!CheckContactVisibility(hContact)))
@@ -621,8 +621,8 @@ int LoadSession(WPARAM wparam,LPARAM lparam)
if(session_list_recovered[0]&&lparam==256&&mode==0)
memcpy(session_list_t,session_list_recovered,SIZEOF(session_list_t));
else
- for (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (hContact = db_find_first(); hContact;
+ hContact = db_find_next(hContact))
{
if(LoadContactsFromMask(hContact,mode,lparam))
{
@@ -691,8 +691,8 @@ int DelUserDefSession(int ses_count)
char szSessionName[256]={0};
TCHAR *szSessionNameBuf=NULL;
- for (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (hContact = db_find_first(); hContact;
+ hContact = db_find_next(hContact))
{
RemoveSessionMark(hContact,1,ses_count);
SetInSessionOrder(hContact,1,ses_count,0);
@@ -738,8 +738,8 @@ int DeleteAutoSession(int ses_count)
TCHAR *szSessionNameBuf=NULL;
- for (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (hContact = db_find_first(); hContact;
+ hContact = db_find_next(hContact))
{
RemoveSessionMark(hContact,0,ses_count);
SetInSessionOrder(hContact,0,ses_count,0);
@@ -913,8 +913,8 @@ static int PluginInit(WPARAM wparam,LPARAM lparam)
HANDLE hContact;
ZeroMemory(session_list_recovered,255);
- for (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (hContact = db_find_first(); hContact;
+ hContact = db_find_next(hContact))
{
if(DBGetContactSettingByte(hContact, __INTERNAL_NAME, "wasInLastSession", 0))
session_list_recovered[i++]=(DWORD)hContact;
diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp
index 4502f2f863..c9c9c9eeba 100644
--- a/plugins/Sessions/Src/Options.cpp
+++ b/plugins/Sessions/Src/Options.cpp
@@ -51,8 +51,8 @@ int OpLoadSessionContacts(WPARAM wparam,LPARAM lparam)
int i=0;
ZeroMemory(session_list_t,SIZEOF(session_list_t));
- for (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (hContact = db_find_first(); hContact;
+ hContact = db_find_next(hContact))
{
if(LoadContactsFromMask(hContact,1,lparam))
{
@@ -300,8 +300,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
if (((LPNMHDR)lparam)->idFrom ==IDC_EMCLIST)
{
int iSelection = (int)((NMCLISTCONTROL *)lparam)->hItem;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- for ( ; hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ HANDLE hContact = db_find_first();
+ for ( ; hContact; hContact = db_find_next(hContact))
if (SendDlgItemMessage(hdlg, IDC_EMCLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0) == iSelection)
break;
if (hContact)
@@ -350,9 +350,9 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
else
{
int i;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
- for ( ; hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for ( ; hContact; hContact = db_find_next(hContact))
SendMessage(hOpClistControl, CLM_SETCHECKMARK, (WPARAM)hContact,0);
for (i=0 ; session_list_t[i]>0; i++)
{
@@ -407,8 +407,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
case IDC_SAVE:
{
int i;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- for (i=0 ; hContact;hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ HANDLE hContact = db_find_first();
+ for (i=0 ; hContact;hContact = db_find_next(hContact))
{
BYTE res =(BYTE)SendMessage(GetDlgItem(hdlg,IDC_EMCLIST), CLM_GETCHECKMARK,
SendMessage(GetDlgItem(hdlg,IDC_EMCLIST), CLM_FINDCONTACT, (WPARAM)hContact, 0), 0);