From 3f23417a1099f73dc28ec1b7d6ec2a1a7fc2b7a2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 18 Jun 2012 20:53:59 +0000 Subject: - PLUGININFO structure removed at all; - Options_AddPage & UserInfo_AddPage replaced MS_OPT_ADDPAGE & MS_USERINFO_ADDPAGE services respectively - total internal redesign of options' translation - code reformatting git-svn-id: http://svn.miranda-ng.org/main/trunk@477 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/autoaway/autoaway.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/modules/autoaway/autoaway.cpp') diff --git a/src/modules/autoaway/autoaway.cpp b/src/modules/autoaway/autoaway.cpp index 055313736b..767800d014 100644 --- a/src/modules/autoaway/autoaway.cpp +++ b/src/modules/autoaway/autoaway.cpp @@ -31,37 +31,37 @@ static int AutoAwayEvent(WPARAM, LPARAM lParam) int i; MIRANDA_IDLE_INFO mii; - mii.cbSize = sizeof( mii ); - CallService( MS_IDLE_GETIDLEINFO, 0, (LPARAM)&mii ); - if ( mii.aaStatus == 0 ) + mii.cbSize = sizeof(mii); + CallService(MS_IDLE_GETIDLEINFO, 0, (LPARAM)&mii); + if (mii.aaStatus == 0) return 0; - for ( i=0; i < accounts.getCount(); i++ ) { + for (i=0; i < accounts.getCount(); i++) { PROTOACCOUNT* pa = accounts[i]; - if (!Proto_IsAccountEnabled( pa ) || Proto_IsAccountLocked( pa )) continue; + if ( !Proto_IsAccountEnabled(pa) || Proto_IsAccountLocked(pa)) continue; - int statusbits = CallProtoService( pa->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0 ); - int currentstatus = CallProtoService( pa->szModuleName, PS_GETSTATUS, 0, 0 ); + int statusbits = CallProtoService(pa->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0); + int currentstatus = CallProtoService(pa->szModuleName, PS_GETSTATUS, 0, 0); int status = mii.aaStatus; - if ( !(statusbits & Proto_Status2Flag(status)) ) { + if ( !(statusbits & Proto_Status2Flag(status))) { // the protocol doesnt support the given status - if ( statusbits & Proto_Status2Flag( ID_STATUS_AWAY )) + if (statusbits & Proto_Status2Flag(ID_STATUS_AWAY)) status = ID_STATUS_AWAY; // the proto doesnt support user mode or even away, bail. else continue; } - if ( currentstatus >= ID_STATUS_ONLINE && currentstatus != ID_STATUS_INVISIBLE ) { - if ((lParam&IDF_ISIDLE) && ( currentstatus == ID_STATUS_ONLINE || currentstatus == ID_STATUS_FREECHAT )) { - DBWriteContactSettingByte( NULL, AA_MODULE, pa->szModuleName, 1 ); - Proto_SetStatus( pa->szModuleName, status ); + if (currentstatus >= ID_STATUS_ONLINE && currentstatus != ID_STATUS_INVISIBLE) { + if ((lParam&IDF_ISIDLE) && (currentstatus == ID_STATUS_ONLINE || currentstatus == ID_STATUS_FREECHAT)) { + DBWriteContactSettingByte(NULL, AA_MODULE, pa->szModuleName, 1); + Proto_SetStatus(pa->szModuleName, status); } - else if ( !(lParam & IDF_ISIDLE) && DBGetContactSettingByte( NULL, AA_MODULE, pa->szModuleName, 0 )) { + else if ( !(lParam & IDF_ISIDLE) && DBGetContactSettingByte(NULL, AA_MODULE, pa->szModuleName, 0)) { // returning from idle and this proto was set away, set it back - DBWriteContactSettingByte( NULL, AA_MODULE, pa->szModuleName, 0 ); - if ( !mii.aaLock ) - Proto_SetStatus( pa->szModuleName, ID_STATUS_ONLINE); + DBWriteContactSettingByte(NULL, AA_MODULE, pa->szModuleName, 0); + if ( !mii.aaLock) + Proto_SetStatus(pa->szModuleName, ID_STATUS_ONLINE); } } } return 0; -- cgit v1.2.3