summaryrefslogtreecommitdiff
path: root/plugins/BasicHistory
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/BasicHistory
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/BasicHistory')
-rw-r--r--plugins/BasicHistory/src/EventList.cpp56
1 files changed, 6 insertions, 50 deletions
diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp
index 96caf57292..22c9122f11 100644
--- a/plugins/BasicHistory/src/EventList.cpp
+++ b/plugins/BasicHistory/src/EventList.cpp
@@ -396,40 +396,10 @@ std::wstring HistoryEventList::GetContactName()
return TranslateT("System");
}
-void GetInfo(CONTACTINFO& ci, std::wstring& str)
-{
- if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) {
- if (ci.type == CNFT_ASCIIZ) {
- str = ci.pszVal;
- mir_free(ci.pszVal);
- }
- else if (ci.type == CNFT_DWORD) {
- TCHAR buf[20];
- _ltot_s(ci.dVal, buf, 10);
- str = buf;
- }
- else if (ci.type == CNFT_WORD) {
- TCHAR buf[20];
- _ltot_s(ci.wVal, buf, 10);
- str = buf;
- }
- }
-}
-
std::wstring HistoryEventList::GetMyName()
{
- std::wstring myName;
- CONTACTINFO ci;
- memset(&ci, 0, sizeof(ci));
- ci.cbSize = sizeof(ci);
- ci.szProto = GetContactProto(m_hContact);
- ci.hContact = 0;
- ci.dwFlag = CNF_DISPLAY | CNF_TCHAR;
- GetInfo(ci, myName);
- if (myName.empty())
- return TranslateT("Me");
-
- return myName;
+ ptrT name(Contact_GetInfo(CNF_DISPLAY, NULL, GetContactProto(m_hContact)));
+ return (name == NULL) ? TranslateT("Me") : name;
}
inline std::wstring GetProtocolName(MCONTACT hContact)
@@ -461,28 +431,14 @@ std::string HistoryEventList::GetBaseProtocol()
std::wstring HistoryEventList::GetMyId()
{
- std::wstring myId;
- CONTACTINFO ci;
- memset(&ci, 0, sizeof(ci));
- ci.cbSize = sizeof(ci);
- ci.szProto = GetContactProto(m_hContact);
- ci.hContact = 0;
- ci.dwFlag = CNF_DISPLAYUID | CNF_TCHAR;
- GetInfo(ci, myId);
- return myId;
+ ptrT id(Contact_GetInfo(CNF_DISPLAYUID, NULL, GetContactProto(m_hContact)));
+ return (id == NULL) ? L"" : id;
}
inline std::wstring GetContactId(MCONTACT hContact)
{
- std::wstring id;
- CONTACTINFO ci;
- memset(&ci, 0, sizeof(ci));
- ci.cbSize = sizeof(ci);
- ci.szProto = GetContactProto(hContact);
- ci.hContact = hContact;
- ci.dwFlag = CNF_DISPLAYUID | CNF_TCHAR;
- GetInfo(ci, id);
- return id;
+ ptrT id(Contact_GetInfo(CNF_DISPLAYUID, hContact));
+ return (id == NULL) ? L"" : id;
}
std::wstring HistoryEventList::GetContactId()