summaryrefslogtreecommitdiff
path: root/plugins/CmdLine
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/CmdLine
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/CmdLine')
-rw-r--r--plugins/CmdLine/src/utils.cpp63
1 files changed, 4 insertions, 59 deletions
diff --git a/plugins/CmdLine/src/utils.cpp b/plugins/CmdLine/src/utils.cpp
index 993b300648..69d3d93578 100644
--- a/plugins/CmdLine/src/utils.cpp
+++ b/plugins/CmdLine/src/utils.cpp
@@ -152,29 +152,8 @@ int GetStringFromDatabase(char *szSettingName, WCHAR *szError, WCHAR *szResult,
#pragma warning (disable: 4312)
char* GetContactName(MCONTACT hContact, char *szProto)
{
- char proto[200];
-
- CONTACTINFO ctInfo;
- memset(&ctInfo, 0, sizeof(ctInfo));
- ctInfo.cbSize = sizeof(ctInfo);
- if (szProto)
- ctInfo.szProto = szProto;
- else {
- GetContactProto(hContact, proto, sizeof(proto));
- ctInfo.szProto = proto;
- }
- ctInfo.dwFlag = CNF_DISPLAY;
- ctInfo.hContact = hContact;
-
- //_debug_message("retrieving contact name for %d", hContact);
- INT_PTR ret = CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) &ctInfo);
- if (ret)
- return NULL;
-
- //_debug_message(" contact name %s", ctInfo.pszVal);
- char *buffer = strdup((char*)ctInfo.pszVal);
- mir_free(ctInfo.pszVal);
- return buffer;
+ ptrT name(Contact_GetInfo(CNF_DISPLAY, hContact, szProto));
+ return (name == NULL) ? NULL : strdup(_T2A(name));
}
#pragma warning (default: 4312)
@@ -196,42 +175,8 @@ char* GetContactID(MCONTACT hContact)
char* GetContactID(MCONTACT hContact, char *szProto)
{
- CONTACTINFO ctInfo;
- memset(&ctInfo, 0, sizeof(ctInfo));
- ctInfo.cbSize = sizeof(ctInfo);
- ctInfo.szProto = szProto;
- ctInfo.dwFlag = CNF_UNIQUEID;
- ctInfo.hContact = hContact;
- INT_PTR ret = CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) &ctInfo);
- if (ret)
- return NULL;
-
- char *buffer;
- char tmp[16];
- switch (ctInfo.type) {
- case CNFT_BYTE:
- mir_snprintf(tmp, "%d", ctInfo.bVal);
- buffer = strdup(tmp);
- break;
-
- case CNFT_WORD:
- mir_snprintf(tmp, "%d", ctInfo.wVal);
- buffer = strdup(tmp);
- break;
-
- case CNFT_DWORD:
- mir_snprintf(tmp, "%ld", ctInfo.dVal);
- buffer = strdup(tmp);
- break;
-
- case CNFT_ASCIIZ:
- default:
- buffer = _strdup((char*)ctInfo.pszVal);
- break;
- }
-
- mir_free(ctInfo.pszVal);
- return buffer;
+ ptrT name(Contact_GetInfo(CNF_UNIQUEID, hContact, szProto));
+ return (name == NULL) ? NULL : strdup(_T2A(name));
}
#pragma warning (default: 4312)