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/FavContacts/src/contact_cache.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'plugins/FavContacts/src') diff --git a/plugins/FavContacts/src/contact_cache.cpp b/plugins/FavContacts/src/contact_cache.cpp index d35e8c890e..38cd4abb62 100644 --- a/plugins/FavContacts/src/contact_cache.cpp +++ b/plugins/FavContacts/src/contact_cache.cpp @@ -116,23 +116,13 @@ float CContactCache::getWeight(int rate) static bool AppendInfo(TCHAR *buf, int size, MCONTACT hContact, int info) { - CONTACTINFO ci = { 0 }; - ci.cbSize = sizeof(ci); - ci.hContact = hContact; - ci.dwFlag = info; - ci.dwFlag |= CNF_UNICODE; - - bool ret = false; - - if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci) && (ci.type == CNFT_ASCIIZ) && ci.pszVal) { - if (*ci.pszVal && (mir_tstrlen(ci.pszVal) < size - 2)) { - mir_tstrcpy(buf, ci.pszVal); - ret = true; - } - mir_free(ci.pszVal); + ptrT str(Contact_GetInfo(info, hContact)); + if (str != NULL) { + mir_tstrncpy(buf, str, size); + return true; } - return ret; + return false; } void CContactCache::TContactInfo::LoadInfo() -- cgit v1.2.3