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/WhenWasIt/src/utils.cpp | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) (limited to 'plugins/WhenWasIt') diff --git a/plugins/WhenWasIt/src/utils.cpp b/plugins/WhenWasIt/src/utils.cpp index 8018101d68..9667b1bc37 100644 --- a/plugins/WhenWasIt/src/utils.cpp +++ b/plugins/WhenWasIt/src/utils.cpp @@ -140,43 +140,13 @@ int GetStringFromDatabase(char *szSettingName, char *szError, char *szResult, si TCHAR* GetContactID(MCONTACT hContact) { - return GetContactID(hContact, GetContactProto(hContact)); + return GetContactID(hContact, NULL); } TCHAR* GetContactID(MCONTACT hContact, char *szProto) { - CONTACTINFO ctInfo = { sizeof(ctInfo) }; - ctInfo.szProto = szProto; - ctInfo.dwFlag = CNF_UNIQUEID | CNF_TCHAR; - ctInfo.hContact = hContact; - INT_PTR ret = CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ctInfo); - TCHAR *buffer; - if (!ret) { - TCHAR tmp[16]; - switch (ctInfo.type) { - case CNFT_BYTE: - mir_sntprintf(tmp, _T("%d"), ctInfo.bVal); - buffer = _tcsdup(tmp); - break; - - case CNFT_WORD: - mir_sntprintf(tmp, _T("%d"), ctInfo.wVal); - buffer = _tcsdup(tmp); - break; - - case CNFT_DWORD: - mir_sntprintf(tmp, _T("%ld"), ctInfo.dVal); - buffer = _tcsdup(tmp); - break; - - default: - buffer = _tcsdup(ctInfo.pszVal); - break; - } - } - - mir_free(ctInfo.pszVal); - return (!ret) ? buffer : NULL; + ptrT res(Contact_GetInfo(CNF_UNIQUEID, hContact, szProto)); + return (res) ? _tcsdup(res) : NULL; } MCONTACT GetContactFromID(TCHAR *szID, char *szProto) -- cgit v1.2.3