summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-04-23 18:48:34 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-04-23 18:48:34 +0300
commitdbca94ca6e16a5bc270332e09ea3703bb46ceeaf (patch)
treed9de6f4ef565dc23561cffe0617d55dfafd5069f /src/mir_app
parent2fb2f4e0edf9c01ff5ec23429e79e2572e5429be (diff)
DbEventIsShown is added to g_chatApi to allow the core to filter group chat events too
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/chat_tools.cpp2
-rw-r--r--src/mir_app/src/srmm_base.cpp6
2 files changed, 3 insertions, 5 deletions
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp
index 50f16f07ba..4ed79d4cc7 100644
--- a/src/mir_app/src/chat_tools.cpp
+++ b/src/mir_app/src/chat_tools.cpp
@@ -730,7 +730,7 @@ void Chat_EventToGC(SESSION_INFO *si, MEVENT hDbEvent)
return;
auto *szProto = Proto_GetBaseAccountName(si->hContact);
- if (mir_strcmp(szProto, dbei.szModule) || dbei.eventType != EVENTTYPE_MESSAGE || !dbei.szUserId)
+ if (mir_strcmp(szProto, dbei.szModule) || !g_chatApi.DbEventIsShown(dbei) || !dbei.szUserId)
return;
CMStringA szText((char *)dbei.pBlob);
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp
index a2b0441945..abf909314a 100644
--- a/src/mir_app/src/srmm_base.cpp
+++ b/src/mir_app/src/srmm_base.cpp
@@ -24,9 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
#include "chat.h"
-#include "resource.h"
#include "skin.h"
-#include <m_history.h>
CSrmmBaseDialog::CSrmmBaseDialog(CMPluginBase &pPlugin, int idDialog, SESSION_INFO *si) :
CDlgBase(pPlugin, idDialog),
@@ -633,13 +631,13 @@ void CSrmmBaseDialog::UpdateChatLog()
auto *szProto = Proto_GetBaseAccountName(m_hContact);
for (MEVENT hDbEvent = m_hDbEventFirst; hDbEvent; hDbEvent = db_event_next(m_hContact, hDbEvent)) {
DB::EventInfo dbei(hDbEvent);
- if (dbei && !mir_strcmp(szProto, dbei.szModule) && dbei.eventType == EVENTTYPE_MESSAGE && dbei.szUserId) {
+ if (dbei && !mir_strcmp(szProto, dbei.szModule) && g_chatApi.DbEventIsShown(dbei) && dbei.szUserId) {
auto *pUser = g_chatApi.UM_FindUser(m_si, Utf2T(dbei.szUserId));
if (pUser == nullptr)
continue;
Utf2T wszUserId(dbei.szUserId);
- CMStringW wszText(Utf2T((char*)dbei.pBlob));
+ CMStringW wszText(ptrW(DbEvent_GetTextW(&dbei, CP_ACP)));
wszText.Replace(L"%", L"%%");
GCEVENT gce = { m_si, GC_EVENT_MESSAGE };