diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2013-02-14 09:54:52 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2013-02-14 09:54:52 +0000 |
commit | c202861e939e64336fd2eb2efc614cbbeeb8bf8e (patch) | |
tree | 134ad4a5c3fccc714dfc30ae8e090abba329f00e /plugins/Variables/src/parse_metacontacts.cpp | |
parent | 262a20f04f06f4e51eca2afeff172b1f75138d88 (diff) |
correct fix for [3590]
git-svn-id: http://svn.miranda-ng.org/main/trunk@3595 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Variables/src/parse_metacontacts.cpp')
-rw-r--r-- | plugins/Variables/src/parse_metacontacts.cpp | 33 |
1 files changed, 9 insertions, 24 deletions
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;
|