From c202861e939e64336fd2eb2efc614cbbeeb8bf8e Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Thu, 14 Feb 2013 09:54:52 +0000 Subject: correct fix for [3590] git-svn-id: http://svn.miranda-ng.org/main/trunk@3595 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Variables/src/parse_metacontacts.cpp | 33 ++++++++-------------------- 1 file changed, 9 insertions(+), 24 deletions(-) (limited to 'plugins/Variables/src/parse_metacontacts.cpp') diff --git a/plugins/Variables/src/parse_metacontacts.cpp b/plugins/Variables/src/parse_metacontacts.cpp index 80cb123e4b..98df006c8c 100644 --- a/plugins/Variables/src/parse_metacontacts.cpp +++ b/plugins/Variables/src/parse_metacontacts.cpp @@ -49,7 +49,6 @@ static TCHAR *parseGetParent(ARGUMENTSINFO *ai) if (hContact == NULL) return NULL; - TCHAR* res = NULL; TCHAR* szUniqueID = NULL; char* szProto = GetContactProto(hContact); if (szProto != NULL) @@ -64,17 +63,13 @@ static TCHAR *parseGetParent(ARGUMENTSINFO *ai) return NULL; } - res = (TCHAR*)mir_alloc((strlen(szProto) + _tcslen(szUniqueID) + 4)*sizeof(TCHAR)); + TCHAR *res = (TCHAR*)mir_alloc((strlen(szProto) + _tcslen(szUniqueID) + 4)*sizeof(TCHAR)); if (res == NULL) { mir_free(szUniqueID); return NULL; } - TCHAR* tszProto; - - tszProto = mir_a2t(szProto); - - + TCHAR *tszProto = mir_a2t(szProto); if (tszProto != NULL && szUniqueID != NULL) { wsprintf(res, _T("<%s:%s>"), tszProto, szUniqueID); mir_free(szUniqueID); @@ -110,7 +105,6 @@ static TCHAR *parseGetDefault(ARGUMENTSINFO *ai) if (hContact == NULL) return NULL; - TCHAR* res = NULL; TCHAR* szUniqueID = NULL; char* szProto = GetContactProto(hContact); if (szProto != NULL) @@ -124,17 +118,13 @@ static TCHAR *parseGetDefault(ARGUMENTSINFO *ai) return NULL; } - res = (TCHAR*)mir_alloc((strlen(szProto) + _tcslen(szUniqueID) + 4)*sizeof(TCHAR)); + TCHAR* res = (TCHAR*)mir_alloc((strlen(szProto) + _tcslen(szUniqueID) + 4)*sizeof(TCHAR)); if (res == NULL) { mir_free(szUniqueID); return NULL; } - TCHAR* tszProto; - - tszProto = mir_a2t(szProto); - - + TCHAR *tszProto = mir_a2t(szProto); if (tszProto != NULL && szUniqueID != NULL) { wsprintf(res, _T("<%s:%s>"), tszProto, szUniqueID); mir_free(szUniqueID); @@ -170,7 +160,6 @@ static TCHAR *parseGetMostOnline(ARGUMENTSINFO *ai) if (hContact == NULL) return NULL; - TCHAR* res = NULL; TCHAR* szUniqueID = NULL; char* szProto = GetContactProto(hContact); if (szProto != NULL) @@ -184,17 +173,13 @@ static TCHAR *parseGetMostOnline(ARGUMENTSINFO *ai) return NULL; } - res = (TCHAR*)mir_alloc((strlen(szProto) + _tcslen(szUniqueID) + 4)*sizeof(TCHAR)); + TCHAR *res = (TCHAR*)mir_alloc((strlen(szProto) + _tcslen(szUniqueID) + 4)*sizeof(TCHAR)); if (res == NULL) { mir_free(szUniqueID); return NULL; } - TCHAR* tszProto; - - tszProto = mir_a2t(szProto); - - + TCHAR *tszProto = mir_a2t(szProto); if (tszProto != NULL && szUniqueID != NULL) { wsprintf(res, _T("<%s:%s>"), tszProto, szUniqueID); mir_free(szUniqueID); @@ -207,9 +192,9 @@ static TCHAR *parseGetMostOnline(ARGUMENTSINFO *ai) int registerMetaContactsTokens() { if (ServiceExists( MS_MC_GETPROTOCOLNAME )) { - registerIntToken( _T(MC_GETPARENT), parseGetParent, TRF_FUNCTION, Translate("MetaContacts\t(x)\tget parent metacontact of contact x")); - registerIntToken( _T(MC_GETDEFAULT), parseGetDefault, TRF_FUNCTION, Translate("MetaContacts\t(x)\tget default subcontact x")); - registerIntToken( _T(MC_GETMOSTONLINE), parseGetMostOnline, TRF_FUNCTION, Translate("MetaContacts\t(x)\tget the 'most online' subcontact x")); + registerIntToken( _T(MC_GETPARENT), parseGetParent, TRF_FUNCTION, LPGEN("MetaContacts")"\t(x)\t"LPGEN("get parent metacontact of contact x")); + registerIntToken( _T(MC_GETDEFAULT), parseGetDefault, TRF_FUNCTION, LPGEN("MetaContacts")"\t(x)\t"LPGEN("get default subcontact x")); + registerIntToken( _T(MC_GETMOSTONLINE), parseGetMostOnline, TRF_FUNCTION, LPGEN("MetaContacts")"\t(x)\t"LPGEN("get the 'most online' subcontact x")); } return 0; -- cgit v1.2.3