summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-04-23 19:36:38 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-04-23 19:36:38 +0300
commitc8a01589f0570bc9f630c4b498c6fb0cc54c79a4 (patch)
treebc55a0f16aed3e113b595251f5c5ee2d10c3689a /src/mir_app
parent1d193f3a887f84ea657f39f9bb3a2e4537426a61 (diff)
Telegram: file events to store server message id & groupchat user id, if present
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/chat_tools.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp
index 4ed79d4cc7..e06e4ab30f 100644
--- a/src/mir_app/src/chat_tools.cpp
+++ b/src/mir_app/src/chat_tools.cpp
@@ -733,13 +733,14 @@ void Chat_EventToGC(SESSION_INFO *si, MEVENT hDbEvent)
if (mir_strcmp(szProto, dbei.szModule) || !g_chatApi.DbEventIsShown(dbei) || !dbei.szUserId)
return;
- CMStringA szText((char *)dbei.pBlob);
- szText.Replace("%", "%%");
+ Utf2T wszUserId(dbei.szUserId);
+ CMStringW wszText(ptrW(DbEvent_GetTextW(&dbei, CP_UTF8)));
+ wszText.Replace(L"%", L"%%");
GCEVENT gce = { si, GC_EVENT_MESSAGE };
- gce.dwFlags = GCEF_ADDTOLOG | GCEF_UTF8;
- gce.pszUID.a = dbei.szUserId;
- gce.pszText.a = szText;
+ gce.dwFlags = GCEF_ADDTOLOG;
+ gce.pszUID.w = wszUserId;
+ gce.pszText.w = wszText;
gce.time = dbei.timestamp;
gce.hEvent = hDbEvent;
Chat_Event(&gce);