summaryrefslogtreecommitdiff
path: root/plugins/WhenWasIt
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-05-18 17:21:08 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-05-18 17:21:08 +0000
commita1d6cb7bdc354be0968c6ba5ac4615e14a90eead (patch)
treea1ed17002c33644b3362e6c1e6572f3fa7ef17d7 /plugins/WhenWasIt
parentfef6b799309b5b9d7cbb2845fa27b777477e2a61 (diff)
these tons of code aren't needed anymore...
git-svn-id: http://svn.miranda-ng.org/main/trunk@16850 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/WhenWasIt')
-rw-r--r--plugins/WhenWasIt/src/utils.cpp36
1 files changed, 3 insertions, 33 deletions
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)