diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-05 22:10:25 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-05 22:10:25 +0300 |
commit | 35e2289786a7f1542573d1a58ebc971970ea981c (patch) | |
tree | da8887c793611fdbf6072fd477fd8c01c60b8b02 /src | |
parent | f7c00d6dc53774d16b9721e79ed5d4017af63884 (diff) |
CLIST_INTERFACE::pfnGetContactDisplayName => Clist_GetContactDisplayName
Diffstat (limited to 'src')
34 files changed, 54 insertions, 62 deletions
diff --git a/src/core/stdaway/src/awaymsg.cpp b/src/core/stdaway/src/awaymsg.cpp index 62929752aa..d5cc58afae 100644 --- a/src/core/stdaway/src/awaymsg.cpp +++ b/src/core/stdaway/src/awaymsg.cpp @@ -55,7 +55,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT message, WPARAM wP WindowList_Add(hWindowList, hwndDlg, dat->hContact);
{
wchar_t str[256], format[128];
- wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ wchar_t *contactName = Clist_GetContactDisplayName(dat->hContact);
char *szProto = GetContactProto(dat->hContact);
WORD dwStatus = db_get_w(dat->hContact, szProto, "Status", ID_STATUS_OFFLINE);
wchar_t *status = Clist_GetStatusModeDescription(dwStatus, 0);
diff --git a/src/core/stdaway/src/main.cpp b/src/core/stdaway/src/main.cpp index 872eb90f22..f9b1b2e174 100644 --- a/src/core/stdaway/src/main.cpp +++ b/src/core/stdaway/src/main.cpp @@ -23,7 +23,6 @@ with this program; if not, write to the Free Software Foundation, Inc., int LoadAwayMsgModule(void);
-CLIST_INTERFACE* pcli;
HINSTANCE hInst;
int hLangpack;
@@ -56,7 +55,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SRAWAY extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
- pcli = Clist_GetInterface();
LoadAwayMsgModule();
return 0;
diff --git a/src/core/stdclist/src/contact.cpp b/src/core/stdclist/src/contact.cpp index d03630e45b..e4fc490248 100644 --- a/src/core/stdclist/src/contact.cpp +++ b/src/core/stdclist/src/contact.cpp @@ -85,10 +85,10 @@ int CompareContacts(const ClcContact* c1, const ClcContact* c2) return 2 * (statusa == ID_STATUS_OFFLINE) - 1;
}
- nameb = pcli->pfnGetContactDisplayName(a, 0);
+ nameb = Clist_GetContactDisplayName(a);
wcsncpy_s(namea, nameb, _TRUNCATE);
namea[ _countof(namea)-1 ] = 0;
- nameb = pcli->pfnGetContactDisplayName(b, 0);
+ nameb = Clist_GetContactDisplayName(b);
//otherwise just compare names
return mir_wstrcmpi(namea, nameb);
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp index 9982d6274c..089f5d999f 100644 --- a/src/core/stdfile/src/file.cpp +++ b/src/core/stdfile/src/file.cpp @@ -108,7 +108,7 @@ void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam) Skin_PlaySound("RecvFile");
wchar_t szTooltip[256];
- mir_snwprintf(szTooltip, TranslateT("File from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(szTooltip, TranslateT("File from %s"), Clist_GetContactDisplayName(hContact));
cle.szTooltip.w = szTooltip;
cle.flags |= CLEF_UNICODE;
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp index 8efbb97dd2..36160ebdf0 100644 --- a/src/core/stdfile/src/filerecvdlg.cpp +++ b/src/core/stdfile/src/filerecvdlg.cpp @@ -136,7 +136,7 @@ void GetContactReceivedFilesDir(MCONTACT hContact, wchar_t *szDir, int cchDir, B REPLACEVARSARRAY rvaVarsToReplace[4];
rvaVarsToReplace[0].key.w = L"nick";
- rvaVarsToReplace[0].value.w = mir_wstrdup((wchar_t *)pcli->pfnGetContactDisplayName(hContact, 0));
+ rvaVarsToReplace[0].value.w = mir_wstrdup(Clist_GetContactDisplayName(hContact));
rvaVarsToReplace[1].key.w = L"userid";
rvaVarsToReplace[1].value.w = GetContactID(hContact);
rvaVarsToReplace[2].key.w = L"proto";
@@ -203,7 +203,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l Button_SetIcon_IcoLib(hwndDlg, IDC_HISTORY, SKINICON_OTHER_HISTORY, LPGEN("View user's history"));
Button_SetIcon_IcoLib(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGEN("User menu"));
- wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ wchar_t *contactName = Clist_GetContactDisplayName(dat->hContact);
SetDlgItemText(hwndDlg, IDC_FROM, contactName);
GetContactReceivedFilesDir(dat->hContact, szPath, _countof(szPath), TRUE);
SetDlgItemText(hwndDlg, IDC_FILEDIR, szPath);
diff --git a/src/core/stdfile/src/filesenddlg.cpp b/src/core/stdfile/src/filesenddlg.cpp index 1a8bee4c54..51231895f0 100644 --- a/src/core/stdfile/src/filesenddlg.cpp +++ b/src/core/stdfile/src/filesenddlg.cpp @@ -235,7 +235,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l SetFileListAndSizeControls(hwndDlg, dat);
}
- wchar_t *contactName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ wchar_t *contactName = Clist_GetContactDisplayName(dat->hContact);
SetDlgItemText(hwndDlg, IDC_TO, contactName);
ptrW id(Contact_GetInfo(CNF_UNIQUEID, dat->hContact));
diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index 37ae7a99e7..98c6f36fba 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -138,21 +138,19 @@ static void SetFilenameControls(HWND hwndDlg, FileDlgData *dat, PROTOFILETRANSFE if (dat->hIcon) DestroyIcon(dat->hIcon); dat->hIcon = nullptr; if (fn && (fts->totalFiles > 1)) { - mir_snwprintf(msg, L"%s: %s (%d %s %d)", - pcli->pfnGetContactDisplayName(fts->hContact, 0), - fn, fts->currentFileNumber + 1, TranslateT("of"), fts->totalFiles); + mir_snwprintf(msg, L"%s: %s (%d %s %d)", Clist_GetContactDisplayName(fts->hContact), fn, fts->currentFileNumber + 1, TranslateT("of"), fts->totalFiles); SHGetFileInfo(fn, FILE_ATTRIBUTE_DIRECTORY, &shfi, sizeof(shfi), SHGFI_USEFILEATTRIBUTES | SHGFI_ICON | SHGFI_SMALLICON); dat->hIcon = shfi.hIcon; } else if (fn) { - mir_snwprintf(msg, L"%s: %s", pcli->pfnGetContactDisplayName(fts->hContact, 0), fn); + mir_snwprintf(msg, L"%s: %s", Clist_GetContactDisplayName(fts->hContact), fn); SHGetFileInfo(fn, FILE_ATTRIBUTE_NORMAL, &shfi, sizeof(shfi), SHGFI_USEFILEATTRIBUTES | SHGFI_ICON | SHGFI_SMALLICON); dat->hIcon = shfi.hIcon; } else { - mir_wstrncpy(msg, pcli->pfnGetContactDisplayName(fts->hContact, 0), _countof(msg)); + mir_wstrncpy(msg, Clist_GetContactDisplayName(fts->hContact), _countof(msg)); HICON hIcon = Skin_LoadIcon(SKINICON_OTHER_DOWNARROW); dat->hIcon = CopyIcon(hIcon); IcoLib_ReleaseIcon(hIcon, NULL); @@ -288,7 +286,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR Button_SetIcon_IcoLib(hwndDlg, IDCANCEL, SKINICON_OTHER_DELETE, LPGEN("Cancel")); - SetDlgItemText(hwndDlg, IDC_CONTACTNAME, pcli->pfnGetContactDisplayName(dat->hContact, 0)); + SetDlgItemText(hwndDlg, IDC_CONTACTNAME, Clist_GetContactDisplayName(dat->hContact)); if (!dat->waitingForAcceptance) SetTimer(hwndDlg, 1, 1000, nullptr); return TRUE; diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 9706b8a49f..ed1e9e0f2f 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -1020,7 +1020,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) wchar_t newtitle[256];
if (m_hContact && m_szProto) {
m_wStatus = db_get_w(m_hContact, m_szProto, "Status", ID_STATUS_OFFLINE);
- wchar_t *contactName = pcli->pfnGetContactDisplayName(m_hContact, 0);
+ wchar_t *contactName = Clist_GetContactDisplayName(m_hContact);
wchar_t *szStatus = Clist_GetStatusModeDescription(m_szProto == nullptr ? ID_STATUS_OFFLINE : db_get_w(m_hContact, m_szProto, "Status", ID_STATUS_OFFLINE), 0);
if (g_dat.bUseStatusWinIcon)
@@ -1221,7 +1221,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) else {
if (m_nTypeSecs) {
wchar_t szBuf[256];
- wchar_t* szContactName = pcli->pfnGetContactDisplayName(m_hContact, 0);
+ wchar_t* szContactName = Clist_GetContactDisplayName(m_hContact);
HICON hTyping = Skin_LoadIcon(SKINICON_OTHER_TYPING);
mir_snwprintf(szBuf, TranslateT("%s is typing a message..."), szContactName);
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 58d6ecf2a7..dac3fdb793 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -274,7 +274,7 @@ static bool CreateRTFFromDbEvent(LogStreamData *dat) else
szName = TranslateT("Me");
}
- else szName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ else szName = Clist_GetContactDisplayName(dat->hContact);
SetToStyle((dbei.flags & DBEF_SENT) ? MSGFONTID_MYNAME : MSGFONTID_YOURNAME, buf);
AppendToBufferWithRTF(buf, szName);
@@ -295,7 +295,7 @@ static bool CreateRTFFromDbEvent(LogStreamData *dat) }
else szName = L"";
}
- else szName = pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ else szName = Clist_GetContactDisplayName(dat->hContact);
SetToStyle(MSGFONTID_NOTICE, buf);
AppendToBufferWithRTF(buf, szName);
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 60b5bbea0f..7c422a5d7b 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -92,7 +92,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) }
wchar_t toolTip[256];
- mir_snwprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(hContact));
CLISTEVENT cle = {};
cle.hContact = hContact;
@@ -171,7 +171,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) SendMessage(hwnd, DM_TYPING, 0, lParam);
else if (lParam && g_dat.bShowTypingTray) {
wchar_t szTip[256];
- mir_snwprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(szTip, TranslateT("%s is typing a message"), Clist_GetContactDisplayName(hContact));
if (g_dat.bShowTypingClist) {
pcli->pfnRemoveEvent(hContact, 1);
@@ -275,7 +275,7 @@ static void RestoreUnreadMessageAlerts(void) cle.szTooltip.w = toolTip;
for (auto &e : arEvents) {
- mir_snwprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(e->hContact, 0));
+ mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(e->hContact));
cle.hContact = e->hContact;
cle.hDbEvent = e->hEvent;
pcli->pfnAddEvent(&cle);
diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp index 0e33116897..bde2ab32f8 100644 --- a/src/core/stdmsg/src/tabs.cpp +++ b/src/core/stdmsg/src/tabs.cpp @@ -140,7 +140,7 @@ CTabbedWindow* CTabbedWindow::AddPage(MCONTACT hContact, wchar_t *pwszText, int pDlg->m_bNoActivate = iNoActivate != 0; if (g_Settings.bTabsEnable) { - m_tab.AddPage(pcli->pfnGetContactDisplayName(hContact, 0), nullptr, pDlg); + m_tab.AddPage(Clist_GetContactDisplayName(hContact), nullptr, pDlg); FixTabIcons(pDlg); m_tab.ActivatePage(m_tab.GetCount() - 1); diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp index fafb7a8f64..ddddbf99da 100644 --- a/src/core/stduihist/src/history.cpp +++ b/src/core/stduihist/src/history.cpp @@ -207,7 +207,7 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP Utils_RestoreWindowPosition(hwndDlg, hContact, "History", "");
{
wchar_t* contactName, str[200];
- contactName = pcli->pfnGetContactDisplayName(hContact, 0);
+ contactName = Clist_GetContactDisplayName(hContact);
mir_snwprintf(str, TranslateT("History for %s"), contactName);
SetWindowText(hwndDlg, str);
}
diff --git a/src/core/stduihist/src/main.cpp b/src/core/stduihist/src/main.cpp index 9236e98444..a598b630cc 100644 --- a/src/core/stduihist/src/main.cpp +++ b/src/core/stduihist/src/main.cpp @@ -23,7 +23,6 @@ with this program; if not, write to the Free Software Foundation, Inc., int LoadHistoryModule(void);
-CLIST_INTERFACE* pcli;
HINSTANCE hInst;
int hLangpack;
@@ -56,7 +55,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_UIHIST extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
- pcli = Clist_GetInterface();
LoadHistoryModule();
return 0;
diff --git a/src/core/stduserinfo/src/main.cpp b/src/core/stduserinfo/src/main.cpp index fc26f29ea7..7e7551ee97 100644 --- a/src/core/stduserinfo/src/main.cpp +++ b/src/core/stduserinfo/src/main.cpp @@ -23,7 +23,6 @@ with this program; if not, write to the Free Software Foundation, Inc., int LoadUserInfoModule(void);
-CLIST_INTERFACE* pcli;
HINSTANCE hInst;
int hLangpack;
@@ -56,7 +55,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_UIUSER extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
- pcli = Clist_GetInterface();
LoadUserInfoModule();
return 0;
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index ffc1747447..aab4733403 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -249,7 +249,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (dat->hContact == NULL)
name = TranslateT("Owner");
else
- name = pcli->pfnGetContactDisplayName(dat->hContact, 0);
+ name = Clist_GetContactDisplayName(dat->hContact);
GetWindowText(hwndDlg, oldTitle, _countof(oldTitle));
mir_snwprintf(newTitle, oldTitle, name);
diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp index ab01edd77a..148eada919 100644 --- a/src/core/stduseronline/src/useronline.cpp +++ b/src/core/stduseronline/src/useronline.cpp @@ -53,7 +53,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam) // only play the sound (or show event) if this event happens at least 10 secs after the proto went from offline
if (GetTickCount() - ticked > (1000*10)) {
wchar_t tooltip[256];
- mir_snwprintf(tooltip, TranslateT("%s is online"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(tooltip, TranslateT("%s is online"), Clist_GetContactDisplayName(hContact));
CLISTEVENT cle = {};
cle.flags = CLEF_ONLYAFEW | CLEF_UNICODE;
diff --git a/src/mir_app/src/addcontact.cpp b/src/mir_app/src/addcontact.cpp index 19e50419ec..2d834fca55 100644 --- a/src/mir_app/src/addcontact.cpp +++ b/src/mir_app/src/addcontact.cpp @@ -178,7 +178,7 @@ MIR_APP_DLL(void) Contact_Add(MCONTACT hContact, HWND hwndParent) CAddByContact(MCONTACT hContact)
{
m_hContact = hContact;
- m_szName = cli.pfnGetContactDisplayName(hContact, 0);
+ m_szName = Clist_GetContactDisplayName(hContact);
m_szProto = GetContactProto(hContact);
}
};
@@ -209,7 +209,7 @@ MIR_APP_DLL(void) Contact_AddByEvent(MEVENT hEvent, HWND hwndParent) m_hContact = dwData[1];
if (m_hContact != INVALID_CONTACT_ID)
- m_szName = cli.pfnGetContactDisplayName(m_hContact, 0);
+ m_szName = Clist_GetContactDisplayName(m_hContact);
m_szProto = dbei.szModule;
}
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index a3240c2ef3..efc9a6a1f4 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -184,7 +184,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char *pszProtoNa pd.lchIcon = LoadIconEx("window", FALSE);
PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
- mir_snwprintf(pd.lptzContactName, L"%s - %s", (pa == nullptr) ? _A2T(pszProtoName) : pa->tszAccountName, cli.pfnGetContactDisplayName(hContact, 0));
+ mir_snwprintf(pd.lptzContactName, L"%s - %s", (pa == nullptr) ? _A2T(pszProtoName) : pa->tszAccountName, Clist_GetContactDisplayName(hContact));
mir_wstrncpy(pd.lptzText, TranslateW(szBuf), _countof(pd.lptzText));
pd.iSeconds = g_Settings->iPopupTimeout;
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index 5fe2cd43d2..b6b78e9157 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -546,7 +546,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
break;
- mir_wstrncpy(contact->szText, cli.pfnGetContactDisplayName(wParam, 0), _countof(contact->szText));
+ mir_wstrncpy(contact->szText, Clist_GetContactDisplayName(wParam), _countof(contact->szText));
dat->bNeedsResort = true;
SortClcByTimer(hwnd);
break;
@@ -557,7 +557,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam contact->proto = GetContactProto(wParam);
cli.pfnInvalidateDisplayNameCacheEntry(wParam);
- mir_wstrncpy(contact->szText, cli.pfnGetContactDisplayName(wParam, 0), _countof(contact->szText));
+ mir_wstrncpy(contact->szText, Clist_GetContactDisplayName(wParam), _countof(contact->szText));
SortClcByTimer(hwnd);
break;
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h index ccc145255f..29530ba84a 100644 --- a/src/mir_app/src/clc.h +++ b/src/mir_app/src/clc.h @@ -115,7 +115,6 @@ int ClcOptInit(WPARAM wParam, LPARAM lParam); void RebuildMenuOrder(void);
/* clistsettings.c */
-wchar_t* fnGetContactDisplayName(MCONTACT hContact, int mode);
void fnGetDefaultFontSetting(int i, LOGFONT *lf, COLORREF * colour);
void fnInvalidateDisplayNameCacheEntry(MCONTACT hContact);
diff --git a/src/mir_app/src/clcitems.cpp b/src/mir_app/src/clcitems.cpp index f0e5e596c4..cc521205d4 100644 --- a/src/mir_app/src/clcitems.cpp +++ b/src/mir_app/src/clcitems.cpp @@ -204,7 +204,7 @@ ClcContact* fnAddContactToGroup(ClcData *dat, ClcGroup *group, MCONTACT hContact DWORD idleMode = szProto != nullptr ? db_get_dw(hContact, szProto, "IdleTS", 0) : 0; if (idleMode) cc->flags |= CONTACTF_IDLE; - mir_wstrncpy(cc->szText, cli.pfnGetContactDisplayName(hContact, 0), _countof(cc->szText)); + mir_wstrncpy(cc->szText, Clist_GetContactDisplayName(hContact), _countof(cc->szText)); return cc; } @@ -380,7 +380,7 @@ void fnRebuildEntireList(HWND hwnd, ClcData *dat) group->totalMembers++; if (dat->bFilterSearch && dat->szQuickSearch[0] != '\0') { - wchar_t *name = cli.pfnGetContactDisplayName(hContact, 0); + wchar_t *name = Clist_GetContactDisplayName(hContact); wchar_t *lowered_name = CharLowerW(NEWWSTR_ALLOCA(name)); wchar_t *lowered_search = CharLowerW(NEWWSTR_ALLOCA(dat->szQuickSearch)); diff --git a/src/mir_app/src/clcutils.cpp b/src/mir_app/src/clcutils.cpp index cb5c5d863f..feb31fcf2b 100644 --- a/src/mir_app/src/clcutils.cpp +++ b/src/mir_app/src/clcutils.cpp @@ -436,7 +436,7 @@ void fnEndRename(HWND, ClcData *dat, int save) }
else if (contact->type == CLCIT_CONTACT) {
cli.pfnInvalidateDisplayNameCacheEntry(contact->hContact);
- wchar_t* otherName = cli.pfnGetContactDisplayName(contact->hContact, GCDNF_NOMYHANDLE);
+ wchar_t* otherName = Clist_GetContactDisplayName(contact->hContact, GCDNF_NOMYHANDLE);
if (!text[0] || !mir_wstrcmp(otherName, text))
db_unset(contact->hContact, "CList", "MyHandle");
else
diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp index e10d24234a..5a58f6e157 100644 --- a/src/mir_app/src/clistcore.cpp +++ b/src/mir_app/src/clistcore.cpp @@ -130,7 +130,6 @@ void InitClistCore() cli.pfnGetImlIconIndex = fnGetImlIconIndex;
cli.pfnRemoveEvent = fnRemoveEvent;
- cli.pfnGetContactDisplayName = fnGetContactDisplayName;
cli.pfnInvalidateDisplayNameCacheEntry = fnInvalidateDisplayNameCacheEntry;
cli.pfnCreateCacheItem = fnCreateCacheItem;
cli.pfnCheckCacheItem = fnCheckCacheItem;
diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp index 986813dcc3..105f06fd91 100644 --- a/src/mir_app/src/clistsettings.cpp +++ b/src/mir_app/src/clistsettings.cpp @@ -103,7 +103,7 @@ void fnInvalidateDisplayNameCacheEntry(MCONTACT hContact) }
}
-wchar_t* fnGetContactDisplayName(MCONTACT hContact, int mode)
+MIR_APP_DLL(wchar_t*) Clist_GetContactDisplayName(MCONTACT hContact, int mode)
{
if (hContact == 0)
return TranslateT("(Unknown contact)");
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 326bca9740..77e539c784 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -127,7 +127,7 @@ static INT_PTR CALLBACK AskForConfirmationDlgProc(HWND hWnd, UINT msg, WPARAM wP wchar_t szFormat[256], szFinal[256];
GetDlgItemText(hWnd, IDC_TOPLINE, szFormat, _countof(szFormat));
- mir_snwprintf(szFinal, szFormat, cli.pfnGetContactDisplayName(lParam, 0));
+ mir_snwprintf(szFinal, szFormat, Clist_GetContactDisplayName(lParam));
SetDlgItemText(hWnd, IDC_TOPLINE, szFinal);
}
SetFocus(GetDlgItem(hWnd, IDNO));
diff --git a/src/mir_app/src/db_events.cpp b/src/mir_app/src/db_events.cpp index e0bc764e6e..4b000a1f75 100644 --- a/src/mir_app/src/db_events.cpp +++ b/src/mir_app/src/db_events.cpp @@ -140,10 +140,10 @@ static INT_PTR DbEventGetTextWorker(DBEVENTINFO *dbei, int codepage, int datatyp if (dbei->eventType == EVENTTYPE_AUTHREQUEST) {
ptrW tszReason(dbei->getString(blob.get_reason()));
text.Format(TranslateT("Authorization request from %s%s: %s"),
- (tszNick == nullptr) ? cli.pfnGetContactDisplayName(blob.get_contact(), 0) : tszNick, nick.c_str(), tszReason);
+ (tszNick == nullptr) ? Clist_GetContactDisplayName(blob.get_contact()) : tszNick, nick.c_str(), tszReason);
}
else text.Format(TranslateT("You were added by %s%s"),
- (tszNick == nullptr) ? cli.pfnGetContactDisplayName(blob.get_contact(), 0) : tszNick, nick.c_str());
+ (tszNick == nullptr) ? Clist_GetContactDisplayName(blob.get_contact()) : tszNick, nick.c_str());
return (datatype == DBVT_WCHAR) ? (INT_PTR)mir_wstrdup(text) : (INT_PTR)mir_u2a(text);
}
diff --git a/src/mir_app/src/meta_addto.cpp b/src/mir_app/src/meta_addto.cpp index fe31f4713d..d44043b808 100644 --- a/src/mir_app/src/meta_addto.cpp +++ b/src/mir_app/src/meta_addto.cpp @@ -50,7 +50,7 @@ static int FillList(HWND list, BOOL sort) continue;
// get contact display name from clist
- wchar_t *swzContactDisplayName = cli.pfnGetContactDisplayName(hMetaUser, 0);
+ wchar_t *swzContactDisplayName = Clist_GetContactDisplayName(hMetaUser);
// don't insert huge strings that we have to compare with later
if (mir_wstrlen(swzContactDisplayName) > 1023)
swzContactDisplayName[1024] = 0;
@@ -173,7 +173,7 @@ void CMetaSelectDlg::OnInitDialog() else
{
// get contact display name from clist
- wchar_t *ptszCDN = cli.pfnGetContactDisplayName(m_hContact, 0);
+ wchar_t *ptszCDN = Clist_GetContactDisplayName(m_hContact);
if (!ptszCDN)
ptszCDN = TranslateT("a contact");
diff --git a/src/mir_app/src/meta_edit.cpp b/src/mir_app/src/meta_edit.cpp index bb233f4ef1..9ebf4e1843 100644 --- a/src/mir_app/src/meta_edit.cpp +++ b/src/mir_app/src/meta_edit.cpp @@ -52,7 +52,7 @@ static void FillContactList(HWND hList) for (int i = 0; i < g_data.num_contacts; i++) {
LvItem.iItem = i;
- wchar_t *ptszCDN = cli.pfnGetContactDisplayName(g_data.hContact[i], 0);
+ wchar_t *ptszCDN = Clist_GetContactDisplayName(g_data.hContact[i]);
if (ptszCDN == nullptr)
ptszCDN = TranslateT("(Unknown contact)");
@@ -270,7 +270,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara case WMU_SETTITLE:
{
- wchar_t *ptszCDN = cli.pfnGetContactDisplayName(lParam, 0);
+ wchar_t *ptszCDN = Clist_GetContactDisplayName(lParam);
if (ptszCDN == nullptr)
ptszCDN = TranslateT("(Unknown contact)");
@@ -366,7 +366,7 @@ static INT_PTR CALLBACK Meta_EditDialogProc(HWND hwndDlg, UINT msg, WPARAM wPara if (g_data.hDefaultContact == g_data.hContact[sel]) {
if (g_data.num_contacts > 0) {
g_data.hDefaultContact = g_data.hContact[0];
- SetDlgItemText(hwndDlg, IDC_ED_DEFAULT, cli.pfnGetContactDisplayName(g_data.hDefaultContact, 0));
+ SetDlgItemText(hwndDlg, IDC_ED_DEFAULT, Clist_GetContactDisplayName(g_data.hDefaultContact));
}
else {
g_data.hDefaultContact = 0;
diff --git a/src/mir_app/src/meta_menu.cpp b/src/mir_app/src/meta_menu.cpp index 954202464d..c12622aa60 100644 --- a/src/mir_app/src/meta_menu.cpp +++ b/src/mir_app/src/meta_menu.cpp @@ -280,7 +280,7 @@ int Meta_ModifyMenu(WPARAM hMeta, LPARAM) Meta_GetSubNick(hMeta, i, tszNick);
ptszName = tszNick.GetBuffer();
}
- else ptszName = cli.pfnGetContactDisplayName(hContact, 0);
+ else ptszName = Clist_GetContactDisplayName(hContact);
HICON hIcon = ImageList_GetIcon(hCListImages, Clist_GetContactIcon(hContact), 0);
Menu_ModifyItem(hMenuContact[i], ptszName, hIcon, 0);
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index 90401e1e58..e95bb68385 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -606,7 +606,7 @@ static int Meta_SrmmIconClicked(WPARAM hMeta, LPARAM lParam) CMStringW tszNick;
if (g_metaOptions.menu_contact_label == DNT_DID)
- tszNick = cli.pfnGetContactDisplayName(cc->pSubs[i], 0);
+ tszNick = Clist_GetContactDisplayName(cc->pSubs[i]);
else
Meta_GetSubNick(hMeta, i, tszNick);
tszNick.AppendFormat(L" [%s]", pa->tszAccountName);
diff --git a/src/mir_app/src/meta_utils.cpp b/src/mir_app/src/meta_utils.cpp index 6fe1980936..86e841468e 100644 --- a/src/mir_app/src/meta_utils.cpp +++ b/src/mir_app/src/meta_utils.cpp @@ -125,7 +125,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) // write the display name
mir_snprintf(buffer, "CListName%d", ccDest->nSubs);
- db_set_ws(hMeta, META_PROTO, buffer, cli.pfnGetContactDisplayName(hSub, 0));
+ db_set_ws(hMeta, META_PROTO, buffer, Clist_GetContactDisplayName(hSub));
// Get the status
WORD status = db_get_w(hSub, szProto, "Status", ID_STATUS_OFFLINE);
@@ -439,7 +439,7 @@ int Meta_CopyContactNick(DBCachedContact *ccMeta, MCONTACT hContact) }
}
else if (g_metaOptions.clist_contact_name == CNNT_DISPLAYNAME) {
- wchar_t *name = cli.pfnGetContactDisplayName(hContact, 0);
+ wchar_t *name = Clist_GetContactDisplayName(hContact);
if (name && mir_wstrcmp(name, TranslateT("(Unknown contact)")) != 0) {
db_set_ws(ccMeta->contactID, META_PROTO, "Nick", name);
return 0;
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 0ea6489984..ce81e5405c 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -554,3 +554,4 @@ Clist_TrayIconIconsChanged @573 Clist_TrayIconDestroy @574
Clist_TrayIconAdd @575
Clist_TraySetTimer @576
+Clist_GetContactDisplayName @577
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 6a43423a98..a46b4aa1e0 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -554,3 +554,4 @@ Clist_TrayIconIconsChanged @573 Clist_TrayIconDestroy @574
Clist_TrayIconAdd @575
Clist_TraySetTimer @576
+Clist_GetContactDisplayName @577
diff --git a/src/mir_app/src/path.cpp b/src/mir_app/src/path.cpp index c97dd7133f..2f5022a17d 100644 --- a/src/mir_app/src/path.cpp +++ b/src/mir_app/src/path.cpp @@ -57,10 +57,10 @@ static __forceinline char *mir_a2x(const char*, const char *s) { return mir_strd static __forceinline char *GetContactNickX(const char*, MCONTACT hContact)
{
- return mir_u2a(cli.pfnGetContactDisplayName(hContact, 0));
+ return mir_u2a(Clist_GetContactDisplayName(hContact));
}
-static __forceinline char *GetContactIDX(const char*, MCONTACT hContact)
+static __forceinline char* GetContactIDX(const char*, MCONTACT hContact)
{
wchar_t *id = GetContactID(hContact);
char* res = mir_u2a(id);
@@ -68,7 +68,7 @@ static __forceinline char *GetContactIDX(const char*, MCONTACT hContact) return res;
}
-static __forceinline char *GetEnvironmentVariableX(const char *variable)
+static __forceinline char* GetEnvironmentVariableX(const char *variable)
{
char result[512];
if (GetEnvironmentVariableA(variable, result, _countof(result)))
@@ -76,12 +76,12 @@ static __forceinline char *GetEnvironmentVariableX(const char *variable) return nullptr;
}
-static __forceinline char *GetProfileDirX(const char*)
+static __forceinline char* GetProfileDirX(const char*)
{
return mir_u2a(g_profileDir);
}
-static __forceinline char *SHGetSpecialFolderPathX(int iCSIDL, char*)
+static __forceinline char* SHGetSpecialFolderPathX(int iCSIDL, char*)
{
char result[512];
if (SHGetSpecialFolderPathA(nullptr, result, iCSIDL, FALSE))
@@ -89,7 +89,7 @@ static __forceinline char *SHGetSpecialFolderPathX(int iCSIDL, char*) return nullptr;
}
-static __forceinline char *GetModulePathX(const char*, HMODULE hModule)
+static __forceinline char* GetModulePathX(const char*, HMODULE hModule)
{
char result[MAX_PATH];
GetModuleFileNameA(hModule, result, sizeof(result));
@@ -98,7 +98,7 @@ static __forceinline char *GetModulePathX(const char*, HMODULE hModule) return mir_strdup(result);
}
-static __forceinline char *GetUserNameX(const char*)
+static __forceinline char* GetUserNameX(const char*)
{
char result[128];
DWORD size = _countof(result);
@@ -107,7 +107,7 @@ static __forceinline char *GetUserNameX(const char*) return nullptr;
}
-static __forceinline char *GetProfileNameX(const char*)
+static __forceinline char* GetProfileNameX(const char*)
{
return mir_u2a(g_shortProfileName);
}
@@ -144,7 +144,7 @@ static __forceinline wchar_t* mir_a2x(const wchar_t *, const char *s) { return m static __forceinline wchar_t* GetContactNickX(const wchar_t*, MCONTACT hContact)
{
- return mir_wstrdup(cli.pfnGetContactDisplayName(hContact, 0));
+ return mir_wstrdup(Clist_GetContactDisplayName(hContact));
}
static __forceinline wchar_t* GetContactIDX(const wchar_t*, MCONTACT hContact)
|