From 35e2289786a7f1542573d1a58ebc971970ea981c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 5 Apr 2018 22:10:25 +0300 Subject: CLIST_INTERFACE::pfnGetContactDisplayName => Clist_GetContactDisplayName --- src/core/stdaway/src/awaymsg.cpp | 2 +- src/core/stdaway/src/main.cpp | 2 -- src/core/stdclist/src/contact.cpp | 4 ++-- src/core/stdfile/src/file.cpp | 2 +- src/core/stdfile/src/filerecvdlg.cpp | 4 ++-- src/core/stdfile/src/filesenddlg.cpp | 2 +- src/core/stdfile/src/filexferdlg.cpp | 10 ++++------ src/core/stdmsg/src/msgdialog.cpp | 4 ++-- src/core/stdmsg/src/msglog.cpp | 4 ++-- src/core/stdmsg/src/msgs.cpp | 6 +++--- src/core/stdmsg/src/tabs.cpp | 2 +- src/core/stduihist/src/history.cpp | 2 +- src/core/stduihist/src/main.cpp | 2 -- src/core/stduserinfo/src/main.cpp | 2 -- src/core/stduserinfo/src/userinfo.cpp | 2 +- src/core/stduseronline/src/useronline.cpp | 2 +- 16 files changed, 22 insertions(+), 30 deletions(-) (limited to 'src/core') 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; -- cgit v1.2.3