summaryrefslogtreecommitdiff
path: root/plugins/SeenPlugin/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-10-10 07:46:53 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-10-10 07:46:53 +0000
commitf90be5cdeec5875d1022e1ef35f5b101bd76ac84 (patch)
tree59e5e8bf3b6a87dbee148bd63f841a8a62daac5f /plugins/SeenPlugin/src
parented10055737300c07e485eb22b27ccf92ffadab7c (diff)
service call replaced with the direct function call
git-svn-id: http://svn.miranda-ng.org/main/trunk@1857 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SeenPlugin/src')
-rw-r--r--plugins/SeenPlugin/src/missed.cpp8
-rw-r--r--plugins/SeenPlugin/src/utils.cpp48
2 files changed, 7 insertions, 49 deletions
diff --git a/plugins/SeenPlugin/src/missed.cpp b/plugins/SeenPlugin/src/missed.cpp
index 179dd8ee4d..bb1568a88b 100644
--- a/plugins/SeenPlugin/src/missed.cpp
+++ b/plugins/SeenPlugin/src/missed.cpp
@@ -67,11 +67,11 @@ int ResetMissed(void)
{
HANDLE hcontact=NULL;
- hcontact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hcontact=db_find_first();
while(hcontact!=NULL)
{
DBWriteContactSettingByte(hcontact,S_MOD,"Missed",0);
- hcontact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hcontact,0);
+ hcontact = db_find_next(hcontact);
}
ZeroMemory(&mcs,sizeof(mcs));
@@ -86,7 +86,7 @@ int CheckIfOnline(void)
// char *szProto;
// WORD status;
- hcontact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hcontact=db_find_first();
while(hcontact!=NULL)
{
/* szProto=(char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hcontact,0);
@@ -96,7 +96,7 @@ int CheckIfOnline(void)
if(CallService(MS_CLIST_GETCONTACTICON,(WPARAM)hcontact,0)!=ICON_OFFLINE)
DBWriteContactSettingByte(hcontact,S_MOD,"Missed",2);
- hcontact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hcontact,0);
+ hcontact = db_find_next(hcontact);
}
return 0;
diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp
index d297f37689..5d64f0e7a9 100644
--- a/plugins/SeenPlugin/src/utils.cpp
+++ b/plugins/SeenPlugin/src/utils.cpp
@@ -713,7 +713,7 @@ static DWORD __stdcall cleanThread(logthread_info* infoParam)
{
Sleep(10000); // I hope in 10 secons all logged-in contacts will be listed
- HANDLE hcontact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ HANDLE hcontact = db_find_first();
while(hcontact != NULL) {
char *contactProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hcontact,0);
if (contactProto) {
@@ -728,7 +728,7 @@ static DWORD __stdcall cleanThread(logthread_info* infoParam)
}
}
}
- hcontact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hcontact,0);
+ hcontact = db_find_next(hcontact);
}
char *str = (char *)malloc(MAXMODULELABELLENGTH+9);
@@ -825,6 +825,7 @@ WCHAR *any_to_IdleNotidleUnknown(HANDLE hContact, const char *module_name, const
buff[bufflen - 1] = 0;
return buff;
}
+
WCHAR *any_to_Idle(HANDLE hContact, const char *module_name, const char *setting_name, WCHAR *buff, int bufflen) {
if(isDbZero(hContact, module_name, setting_name)==0) { //DB setting is NOT zero and exists
buff[0] = L'/';
@@ -833,46 +834,3 @@ WCHAR *any_to_Idle(HANDLE hContact, const char *module_name, const char *setting
buff[bufflen - 1] = 0;
return buff;
}
-
-
-/*int GetInfoAck(WPARAM wparam,LPARAM lparam)
-{
- ACKDATA *ack;
- DWORD dwsetting=0;
-
- ack=(ACKDATA *)lparam;
-
- if(ack->type!=ACKTYPE_GETINFO || ack->hContact==NULL) return 0;
- if (((int)ack->hProcess-1)!=(int)ack->lParam) return 0;
-
- dwsetting=DBGetContactSettingDword(ack->hContact,ack->szModule,"IP",0);
- if(dwsetting)
- DBWriteContactSettingDword(ack->hContact,S_MOD,"IP",dwsetting);
-
- dwsetting=DBGetContactSettingDword(ack->hContact,ack->szModule,"RealIP",0);
- if(dwsetting)
- DBWriteContactSettingDword(ack->hContact,S_MOD,"RealIP",dwsetting);
-
- return 0;
-}*/
-
-
-
-/*void SetOffline(void)
-{
- HANDLE hcontact=NULL;
- char * szProto;
-
- hcontact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
- while(hcontact!=NULL)
- {
- szProto=(char *)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hcontact,0);
- if (szProto != NULL && IsWatchedProtocol(szProto)) {
- DBWriteContactSettingByte(hcontact,S_MOD,"Offline",1);
- }
- hcontact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hcontact,0);
- }
-}*/
-
-
-