summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-05-14 17:18:48 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-05-14 17:18:48 +0300
commit7e6e9d24fc04f5e448e8a66402778de24b1cb25a (patch)
treed0979bb17e66d5db71a7aa0dc421f1f99d0f0e1b
parent5a09915186e4ae70cc39e9343ca02a1b860d7f94 (diff)
fix for nickname substitution in chat API popups
-rw-r--r--src/mir_app/src/chat_tools.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp
index 53b4a33700..760dcb04fe 100644
--- a/src/mir_app/src/chat_tools.cpp
+++ b/src/mir_app/src/chat_tools.cpp
@@ -226,7 +226,8 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char *pszProtoNa
BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce)
{
fakeLOGINFO lin(gce);
- CMStringW wszText;
+ CMStringW wszText, wszNick;
+ g_chatApi.CreateNick(si, &lin, wszNick);
bool bTextUsed = Chat_GetDefaultEventDescr(si, &lin, wszText);
HICON hIcon = nullptr;
@@ -234,13 +235,13 @@ BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce)
switch (gce->iType) {
case GC_EVENT_MESSAGE | GC_EVENT_HIGHLIGHT:
- hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE); dwColor = g_chatApi.aFonts[16].color; wszText = TranslateT("%s says");
+ hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE); dwColor = g_chatApi.aFonts[16].color; wszText.Format(TranslateT("%s says"), wszNick.c_str());
break;
case GC_EVENT_ACTION | GC_EVENT_HIGHLIGHT:
hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE); dwColor = g_chatApi.aFonts[16].color;
break;
case GC_EVENT_MESSAGE:
- hIcon = g_chatApi.hIcons[ICON_MESSAGE]; dwColor = g_chatApi.aFonts[9].color; wszText = TranslateT("%s says");
+ hIcon = g_chatApi.hIcons[ICON_MESSAGE]; dwColor = g_chatApi.aFonts[9].color; wszText.Format(TranslateT("%s says"), wszNick.c_str());
break;
case GC_EVENT_ACTION:
hIcon = g_chatApi.hIcons[ICON_ACTION]; dwColor = g_chatApi.aFonts[15].color;