diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2013-03-27 07:44:35 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2013-03-27 07:44:35 +0000 |
commit | 04d05218bf3278dcd33a8491729c0138b20cc9f8 (patch) | |
tree | 9ba401d5e2f5a3a17b998efe5db417d1f030992a /plugins/IEView | |
parent | 869739a3cc7ce25532c178e6d3e11f65cafc3d30 (diff) |
removed not needed string compare (patch from Mataes)
git-svn-id: http://svn.miranda-ng.org/main/trunk@4214 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/IEView')
-rw-r--r-- | plugins/IEView/src/HTMLBuilder.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index ccda13793d..8bfcf658e2 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -242,7 +242,7 @@ void HTMLBuilder::getUINs(HANDLE hContact, char *&uinIn, char *&uinOut) { mir_free(szProto);
}
-wchar_t *HTMLBuilder::getContactName(HANDLE hContact, const char* szProto)
+wchar_t *HTMLBuilder::getContactName(HANDLE hContact, const char *szProto)
{
CONTACTINFO ci = {0};
wchar_t *szName = NULL;
@@ -251,35 +251,30 @@ wchar_t *HTMLBuilder::getContactName(HANDLE hContact, const char* szProto) ci.hContact = hContact;
ci.szProto = (char *)szProto;
ci.dwFlag = CNF_DISPLAY | CNF_UNICODE;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci)) {
+ if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) &ci)) {
if (ci.type == CNFT_ASCIIZ) {
if (ci.pszVal) {
- if (!wcscmp((wchar_t *)ci.pszVal, TranslateW(L"'(Unknown Contact)'"))) {
- ci.dwFlag &= ~CNF_UNICODE;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci)) {
- szName = ci.pszVal;
- }
- } else {
- szName = mir_tstrdup(ci.pszVal);
- }
+ szName = mir_tstrdup(ci.pszVal);
mir_free(ci.pszVal);
}
}
}
if (szName != NULL) return szName;
+
ci.dwFlag = CNF_UNIQUEID;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci)) {
+ if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) &ci)) {
if (ci.type == CNFT_ASCIIZ) {
if (ci.pszVal) {
- szName = ci.pszVal;
+ szName = mir_tstrdup(ci.pszVal);
mir_free(ci.pszVal);
}
}
}
if (szName != NULL) return szName;
- char *szNameStr = (char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, 0);
+
+ TCHAR *szNameStr = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR);
if (szNameStr != NULL) {
- return mir_a2t(szNameStr);
+ return szNameStr;
}
return mir_tstrdup(TranslateT("(Unknown Contact)"));
}
|