diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-25 12:54:45 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-25 12:54:45 +0000 |
commit | bd8a04455d9c991c15df2287e091abe4ba054efb (patch) | |
tree | 6af5485d60feef741669eb545a6378e7c209ab59 /plugins/AutoShutdown | |
parent | 7fdce14cd488e25e8e32e34098fbe9f5cb3021b7 (diff) |
typed stub for MS_PROTO_GETCONTACTBASEPROTO
git-svn-id: http://svn.miranda-ng.org/main/trunk@2480 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AutoShutdown')
-rw-r--r-- | plugins/AutoShutdown/src/watcher.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index 99c3d524c5..0162ca5867 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -177,13 +177,11 @@ static int IdleChanged(WPARAM wParam,LPARAM lParam) static BOOL CheckAllContactsOffline(void)
{
BOOL fSmartCheck,fAllOffline=TRUE; /* tentatively */
- HANDLE hContact;
- char *pszProto;
fSmartCheck=DBGetContactSettingByte(NULL,"AutoShutdown","SmartOfflineCheck",SETTING_SMARTOFFLINECHECK_DEFAULT);
- hContact=db_find_first();
- while(hContact!=NULL) {
- pszProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
- if(pszProto!=NULL && CallProtoService(pszProto,PS_GETSTATUS,0,0)!=ID_STATUS_OFFLINE)
+ HANDLE hContact = db_find_first();
+ while(hContact != NULL) {
+ char *pszProto = GetContactProto(hContact);
+ if(pszProto != NULL && CallProtoService(pszProto,PS_GETSTATUS,0,0)!=ID_STATUS_OFFLINE)
if(DBGetContactSettingByte(hContact,pszProto,"ChatRoom",0)) continue;
if(DBGetContactSettingWord(hContact,pszProto,"Status",0)!=ID_STATUS_OFFLINE) {
if(fSmartCheck) {
@@ -203,7 +201,7 @@ static int StatusSettingChanged(WPARAM wParam,LPARAM lParam) if(currentWatcherType&SDWTF_STATUS) {
DBCONTACTWRITESETTING *dbcws=(DBCONTACTWRITESETTING*)lParam;
if((HANDLE)wParam!=NULL && dbcws->value.wVal==ID_STATUS_OFFLINE && !lstrcmpA(dbcws->szSetting,"Status")) {
- char *pszProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0);
+ char *pszProto = GetContactProto((HANDLE)wParam);
if(pszProto!=NULL && !lstrcmpA(dbcws->szModule,pszProto))
if(CheckAllContactsOffline())
ShutdownAndStopWatcher();
@@ -239,7 +237,7 @@ static BOOL CALLBACK CpuUsageWatcherProc(BYTE nCpuUsage,LPARAM lParam) static int WeatherUpdated(WPARAM wParam,LPARAM lParam)
{
- char *pszProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0);
+ char *pszProto = GetContactProto((HANDLE)wParam);
if((BOOL)lParam && pszProto!=NULL && CallProtoService(pszProto,PS_GETSTATUS,0,0)==THUNDER)
if(DBGetContactSettingByte(NULL,"AutoShutdown","WeatherShutdown",SETTING_WEATHERSHUTDOWN_DEFAULT))
ServiceShutdown(SDSDT_SHUTDOWN,TRUE);
|