From a1d6cb7bdc354be0968c6ba5ac4615e14a90eead Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 18 May 2016 17:21:08 +0000 Subject: these tons of code aren't needed anymore... git-svn-id: http://svn.miranda-ng.org/main/trunk@16850 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Variables/src/contact.cpp | 27 +-------------------------- plugins/Variables/src/parse_miranda.cpp | 11 ++--------- 2 files changed, 3 insertions(+), 35 deletions(-) (limited to 'plugins/Variables/src') diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp index 7ab46f484e..88b93ea931 100644 --- a/plugins/Variables/src/contact.cpp +++ b/plugins/Variables/src/contact.cpp @@ -164,32 +164,7 @@ TCHAR* getContactInfoT(BYTE type, MCONTACT hContact) break; } - CONTACTINFO ci = { sizeof(ci) }; - ci.hContact = hContact; - ci.dwFlag = type | CNF_UNICODE; - CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci); - - char szVal[16]; - memset(szVal, '\0', sizeof(szVal)); - switch (ci.type) { - case CNFT_BYTE: - if (type == CNF_GENDER) { - szVal[0] = (char)ci.bVal; szVal[1] = 0; - return mir_a2t(szVal); - } - return itot(ci.bVal); - - case CNFT_WORD: - return itot(ci.wVal); - - case CNFT_DWORD: - return itot(ci.dVal); - - case CNFT_ASCIIZ: - return ci.pszVal; - } - - return NULL; + return Contact_GetInfo(type, hContact); } // MS_VARS_GETCONTACTFROMSTRING diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp index e6431a19cb..42a9762bd4 100644 --- a/plugins/Variables/src/parse_miranda.cpp +++ b/plugins/Variables/src/parse_miranda.cpp @@ -361,15 +361,8 @@ static TCHAR* parseProtoInfo(ARGUMENTSINFO *ai) if (INT_PTR(szRes) == CALLSERVICE_NOTFOUND) return NULL; } - else if (!mir_tstrcmp(ai->targv[2], _T(STR_PINICK))) { - CONTACTINFO ci; - ci.cbSize = sizeof(CONTACTINFO); - ci.dwFlag = CNF_DISPLAY | CNF_UNICODE; - ci.hContact = NULL; - ci.szProto = szProto; - CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci); - tszRes = ci.pszVal; - } + else if (!mir_tstrcmp(ai->targv[2], _T(STR_PINICK))) + tszRes = Contact_GetInfo(CNF_DISPLAY, NULL, szProto); if (szRes == NULL && tszRes == NULL) return NULL; -- cgit v1.2.3