summaryrefslogtreecommitdiff
path: root/src/modules/metacontacts/meta_services.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-06-28 20:44:06 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-06-28 20:44:06 +0000
commitc6e1bedfc18495b3e083069f8d03c2218f6f6b78 (patch)
treecf5583c51cd9c1d6b3faddc6a60235362fc0d624 /src/modules/metacontacts/meta_services.cpp
parent9f4c313f4f644e5ebb29086210f492941c732956 (diff)
fixes #630 p.2 (user must have a choice to display either Nick or DisplayName in SRMM menu)
git-svn-id: http://svn.miranda-ng.org/main/trunk@9605 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/metacontacts/meta_services.cpp')
-rw-r--r--src/modules/metacontacts/meta_services.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/modules/metacontacts/meta_services.cpp b/src/modules/metacontacts/meta_services.cpp
index b95152925d..0f0997ada4 100644
--- a/src/modules/metacontacts/meta_services.cpp
+++ b/src/modules/metacontacts/meta_services.cpp
@@ -599,12 +599,9 @@ static int Meta_SrmmIconClicked(WPARAM hMeta, LPARAM lParam)
HMENU hMenu = CreatePopupMenu();
int iDefault = Meta_GetContactNumber(cc, db_mc_getSrmmSub(cc->contactID));
- TCHAR tszItemName[200];
MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_ID | MIIM_STATE | MIIM_STRING;
- mii.dwTypeData = tszItemName;
- mii.cch = SIZEOF(tszItemName);
for (int i = 0; i < cc->nSubs; i++) {
char *szProto = GetContactProto(cc->pSubs[i]);
if (szProto == NULL) continue;
@@ -613,11 +610,17 @@ static int Meta_SrmmIconClicked(WPARAM hMeta, LPARAM lParam)
if (pa == NULL)
continue;
- mir_sntprintf(tszItemName, SIZEOF(tszItemName), _T("%s [%s]"),
- cli.pfnGetContactDisplayName(cc->pSubs[i], 0), pa->tszAccountName);
+ CMString tszNick;
+ if (options.menu_contact_label == DNT_DID)
+ tszNick = cli.pfnGetContactDisplayName(cc->pSubs[i], 0);
+ else
+ Meta_GetSubNick(hMeta, i, tszNick);
+ tszNick.AppendFormat(_T(" [%s]"), pa->tszAccountName);
mii.wID = i + 1;
mii.fState = (i == iDefault) ? MFS_CHECKED : MFS_ENABLED;
+ mii.dwTypeData = tszNick.GetBuffer();
+ mii.cch = tszNick.GetLength();
InsertMenuItem(hMenu, i, TRUE, &mii);
}
@@ -690,6 +693,7 @@ static VOID CALLBACK sttMenuThread(PVOID param)
}
/////////////////////////////////////////////////////////////////////////////////////////
+
INT_PTR Meta_ContactMenuFunc(WPARAM hMeta, LPARAM lParam)
{
DBCachedContact *cc = CheckMeta(hMeta);