From b33e2997d6a2f98b18571e92468f4db39254a42f Mon Sep 17 00:00:00 2001 From: Alexey Kulakov Date: Mon, 25 Jun 2012 07:09:31 +0000 Subject: next step of external api cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@625 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- .../StatusPlugins/StartupStatus/StartupStatus.rc | 4 +- plugins/StatusPlugins/commonstatus.cpp | 58 +++++++++------------- plugins/StatusPlugins/commonstatus.h | 1 - plugins/StatusPlugins/resource.rc | 4 +- plugins/StatusPlugins/version.rc | 2 +- 5 files changed, 28 insertions(+), 41 deletions(-) (limited to 'plugins/StatusPlugins') diff --git a/plugins/StatusPlugins/StartupStatus/StartupStatus.rc b/plugins/StatusPlugins/StartupStatus/StartupStatus.rc index 8f41f36229..a7a2bebb2a 100644 --- a/plugins/StatusPlugins/StartupStatus/StartupStatus.rc +++ b/plugins/StatusPlugins/StartupStatus/StartupStatus.rc @@ -7,7 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include "winres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -34,7 +34,7 @@ END 2 TEXTINCLUDE BEGIN - "#include ""afxres.h""\r\n" + "#include ""winres.h""\r\n" "\0" END diff --git a/plugins/StatusPlugins/commonstatus.cpp b/plugins/StatusPlugins/commonstatus.cpp index fb9bac079e..d1e214b307 100644 --- a/plugins/StatusPlugins/commonstatus.cpp +++ b/plugins/StatusPlugins/commonstatus.cpp @@ -313,43 +313,31 @@ static void SetStatusMsg(PROTOCOLSETTINGEX *ps, int newstatus) { TCHAR* tszMsg = GetDefaultStatusMessage( ps, newstatus ); if ( tszMsg ) { - if ( ServiceExists( MS_VSRAMM_SETAWAYMSG )) { - PROTOMSGINFO pmi; - - pmi.statusMode = ps->status; - pmi.szProto = ps->szName; - pmi.msg = mir_t2a( tszMsg ); - log_debugA("CommonStatus sets status message for %s using VSRAMM", ps->szName); - CallService( MS_VSRAMM_SETAWAYMSG, 0, (LPARAM)&pmi ); - mir_free( pmi.msg ); - } - else { /* replace the default vars in msg (I believe this is from core) */ - for ( int j=0; tszMsg[j]; j++ ) { - TCHAR substituteStr[128]; - - if ( tszMsg[j] != '%' ) - continue; - - if ( !_tcsnicmp( tszMsg+j, _T("%time%"), 6 )) - GetTimeFormat( LOCALE_USER_DEFAULT, TIME_NOSECONDS, 0, 0, substituteStr, SIZEOF(substituteStr)); - else if ( !_tcsnicmp( tszMsg+j, _T("%date%"), 6 )) - GetDateFormat( LOCALE_USER_DEFAULT, DATE_SHORTDATE, 0, 0, substituteStr, SIZEOF(substituteStr)); - else - continue; - - if ( lstrlen( substituteStr ) > 6 ) - tszMsg = (TCHAR*)mir_realloc(tszMsg, sizeof(TCHAR)*(lstrlen(tszMsg)+1+lstrlen(substituteStr)-6)); - MoveMemory( tszMsg + j + lstrlen(substituteStr), tszMsg+j+6, sizeof(TCHAR)*(lstrlen(tszMsg)-j-5)); - CopyMemory( tszMsg + j, substituteStr, sizeof(TCHAR)*lstrlen( substituteStr )); - } + for ( int j=0; tszMsg[j]; j++ ) { + TCHAR substituteStr[128]; - TCHAR* szFormattedMsg = variables_parsedup(tszMsg, ps->tszAccName, NULL); - if (szFormattedMsg != NULL) { - mir_free( tszMsg ); - tszMsg = mir_tstrdup( szFormattedMsg ); - free( szFormattedMsg ); - } + if ( tszMsg[j] != '%' ) + continue; + + if ( !_tcsnicmp( tszMsg+j, _T("%time%"), 6 )) + GetTimeFormat( LOCALE_USER_DEFAULT, TIME_NOSECONDS, 0, 0, substituteStr, SIZEOF(substituteStr)); + else if ( !_tcsnicmp( tszMsg+j, _T("%date%"), 6 )) + GetDateFormat( LOCALE_USER_DEFAULT, DATE_SHORTDATE, 0, 0, substituteStr, SIZEOF(substituteStr)); + else + continue; + + if ( lstrlen( substituteStr ) > 6 ) + tszMsg = (TCHAR*)mir_realloc(tszMsg, sizeof(TCHAR)*(lstrlen(tszMsg)+1+lstrlen(substituteStr)-6)); + MoveMemory( tszMsg + j + lstrlen(substituteStr), tszMsg+j+6, sizeof(TCHAR)*(lstrlen(tszMsg)-j-5)); + CopyMemory( tszMsg + j, substituteStr, sizeof(TCHAR)*lstrlen( substituteStr )); + } + + TCHAR* szFormattedMsg = variables_parsedup(tszMsg, ps->tszAccName, NULL); + if (szFormattedMsg != NULL) { + mir_free( tszMsg ); + tszMsg = mir_tstrdup( szFormattedMsg ); + free( szFormattedMsg ); } } diff --git a/plugins/StatusPlugins/commonstatus.h b/plugins/StatusPlugins/commonstatus.h index 5c0a531d0c..e0909e94ac 100644 --- a/plugins/StatusPlugins/commonstatus.h +++ b/plugins/StatusPlugins/commonstatus.h @@ -44,7 +44,6 @@ #include #include #include "m_statusplugins.h" -#include #include #include #include diff --git a/plugins/StatusPlugins/resource.rc b/plugins/StatusPlugins/resource.rc index 99658d9ecb..c4fa7935d1 100644 --- a/plugins/StatusPlugins/resource.rc +++ b/plugins/StatusPlugins/resource.rc @@ -7,7 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include "winres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -34,7 +34,7 @@ END 2 TEXTINCLUDE BEGIN - "#include ""afxres.h""\r\n" + "#include ""winres.h""\r\n" "\0" END diff --git a/plugins/StatusPlugins/version.rc b/plugins/StatusPlugins/version.rc index 8f6f25b2da..9ac8419e99 100644 --- a/plugins/StatusPlugins/version.rc +++ b/plugins/StatusPlugins/version.rc @@ -1,5 +1,5 @@ #include "version.h" -#include "afxres.h" +#include "winres.h" #ifdef _WIN32 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -- cgit v1.2.3