summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-05 22:10:25 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-05 22:10:25 +0300
commit35e2289786a7f1542573d1a58ebc971970ea981c (patch)
treeda8887c793611fdbf6072fd477fd8c01c60b8b02 /src/mir_app
parentf7c00d6dc53774d16b9721e79ed5d4017af63884 (diff)
CLIST_INTERFACE::pfnGetContactDisplayName => Clist_GetContactDisplayName
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/addcontact.cpp4
-rw-r--r--src/mir_app/src/chat_tools.cpp2
-rw-r--r--src/mir_app/src/clc.cpp4
-rw-r--r--src/mir_app/src/clc.h1
-rw-r--r--src/mir_app/src/clcitems.cpp4
-rw-r--r--src/mir_app/src/clcutils.cpp2
-rw-r--r--src/mir_app/src/clistcore.cpp1
-rw-r--r--src/mir_app/src/clistsettings.cpp2
-rw-r--r--src/mir_app/src/clui.cpp2
-rw-r--r--src/mir_app/src/db_events.cpp4
-rw-r--r--src/mir_app/src/meta_addto.cpp4
-rw-r--r--src/mir_app/src/meta_edit.cpp6
-rw-r--r--src/mir_app/src/meta_menu.cpp2
-rw-r--r--src/mir_app/src/meta_services.cpp2
-rw-r--r--src/mir_app/src/meta_utils.cpp4
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
-rw-r--r--src/mir_app/src/path.cpp18
18 files changed, 32 insertions, 32 deletions
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)