diff options
author | George Hazan <george.hazan@gmail.com> | 2016-05-18 17:21:08 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-05-18 17:21:08 +0000 |
commit | a1d6cb7bdc354be0968c6ba5ac4615e14a90eead (patch) | |
tree | a1ed17002c33644b3362e6c1e6572f3fa7ef17d7 /plugins/IEView/src/HTMLBuilder.cpp | |
parent | fef6b799309b5b9d7cbb2845fa27b777477e2a61 (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/IEView/src/HTMLBuilder.cpp')
-rw-r--r-- | plugins/IEView/src/HTMLBuilder.cpp | 69 |
1 files changed, 16 insertions, 53 deletions
diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index 272b08e891..c80d259648 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -182,65 +182,28 @@ bool HTMLBuilder::isSameDate(time_t time1, time_t time2) void HTMLBuilder::getUINs(MCONTACT hContact, char *&uinIn, char *&uinOut)
{
- CONTACTINFO ci = { 0 };
- char buf[128] = { 0 };
- const char *szProto = GetContactProto(hContact);
-
hContact = getRealContact(hContact);
- ci.cbSize = sizeof(ci);
- ci.hContact = hContact;
- ci.szProto = const_cast<char*>(szProto);
- ci.dwFlag = CNF_UNIQUEID;
+ ptrT id(Contact_GetInfo(CNF_UNIQUEID, hContact));
+ uinIn = mir_utf8encodeT((id != NULL) ? id : _T(""));
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)& ci)) {
- switch (ci.type) {
- case CNFT_ASCIIZ:
- strncpy_s(buf, (char*)ci.pszVal, _TRUNCATE);
- mir_free(ci.pszVal);
- break;
- case CNFT_DWORD:
- mir_snprintf(buf, "%u", ci.dVal);
- break;
- }
- }
- uinIn = mir_utf8encode(buf);
- ci.hContact = NULL;
-
- buf[0] = 0;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)& ci)) {
- switch (ci.type) {
- case CNFT_ASCIIZ:
- strncpy_s(buf, (char*)ci.pszVal, _TRUNCATE);
- mir_free(ci.pszVal);
- break;
- case CNFT_DWORD:
- mir_snprintf(buf, "%u", ci.dVal);
- break;
- }
- }
- uinOut = mir_utf8encode(buf);
+ id = Contact_GetInfo(CNF_UNIQUEID, NULL);
+ uinOut = mir_utf8encodeT((id != NULL) ? id : _T(""));
}
-wchar_t *HTMLBuilder::getContactName(MCONTACT hContact, const char *szProto)
+wchar_t* HTMLBuilder::getContactName(MCONTACT hContact, const char *szProto)
{
- CONTACTINFO ci = { 0 };
- ci.cbSize = sizeof(ci);
- ci.hContact = hContact;
- ci.szProto = (char *)szProto;
- ci.dwFlag = CNF_DISPLAY | CNF_UNICODE;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci))
- if (ci.type == CNFT_ASCIIZ && ci.pszVal) // already mir_tstrdup'ed
- return ci.pszVal;
-
- ci.dwFlag = CNF_UNIQUEID;
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci))
- if (ci.type == CNFT_ASCIIZ && ci.pszVal) // already mir_tstrdup'ed
- return ci.pszVal;
-
- TCHAR *szNameStr = pcli->pfnGetContactDisplayName(hContact, 0);
- if (szNameStr != NULL)
- return mir_tstrdup(szNameStr);
+ TCHAR *str = Contact_GetInfo(CNF_DISPLAY, hContact, szProto);
+ if (str != NULL)
+ return str;
+
+ str = Contact_GetInfo(CNF_UNIQUEID, hContact, szProto);
+ if (str != NULL)
+ return str;
+
+ str = pcli->pfnGetContactDisplayName(hContact, 0);
+ if (str != NULL)
+ return mir_tstrdup(str);
return mir_tstrdup(TranslateT("(Unknown Contact)"));
}
|