summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/m_chat_int.h2
-rw-r--r--plugins/Scriver/src/chat_main.cpp1
-rw-r--r--plugins/TabSRMM/src/chat_main.cpp3
-rw-r--r--plugins/TabSRMM/src/msglog.cpp2
-rw-r--r--src/core/stdmsg/src/chat_manager.cpp1
-rw-r--r--src/core/stdmsg/src/stdafx.h31
-rw-r--r--src/mir_app/src/chat_tools.cpp2
-rw-r--r--src/mir_app/src/srmm_base.cpp6
8 files changed, 25 insertions, 23 deletions
diff --git a/include/m_chat_int.h b/include/m_chat_int.h
index 95a8c10206..3698ef4203 100644
--- a/include/m_chat_int.h
+++ b/include/m_chat_int.h
@@ -319,6 +319,8 @@ struct CHAT_MANAGER
MIR_APP_DLL(HICON) getIcon(int iEventType) const;
// user-defined custom callbacks
+ bool (*DbEventIsShown)(const DB::EventInfo &dbei);
+
void (*OnCreateModule)(MODULEINFO*);
void (*OnDestroyModule)(MODULEINFO*);
diff --git a/plugins/Scriver/src/chat_main.cpp b/plugins/Scriver/src/chat_main.cpp
index 0297bbef01..cee6777e6b 100644
--- a/plugins/Scriver/src/chat_main.cpp
+++ b/plugins/Scriver/src/chat_main.cpp
@@ -146,6 +146,7 @@ int Chat_Load()
g_chatApi.OnFlashWindow = OnFlashWindow;
g_chatApi.OnFlashHighlight = OnFlashHighlight;
g_chatApi.ShowRoom = ShowRoom;
+ g_chatApi.DbEventIsShown = DbEventIsShown;
Srmm_CreateHotkey(LPGEN("Messaging"), LPGEN("Action: Send message"));
diff --git a/plugins/TabSRMM/src/chat_main.cpp b/plugins/TabSRMM/src/chat_main.cpp
index 1a4a20082a..53e19d35a1 100644
--- a/plugins/TabSRMM/src/chat_main.cpp
+++ b/plugins/TabSRMM/src/chat_main.cpp
@@ -365,9 +365,10 @@ int Chat_Load()
g_chatApi.OnCreateSession = OnCreateSession;
g_chatApi.OnReplaceSession = OnReplaceSession;
- g_chatApi.OnChangeNick = OnChangeNick;
g_chatApi.ShowRoom = stubShowRoom;
+ g_chatApi.OnChangeNick = OnChangeNick;
g_chatApi.OnLoadSettings = OnLoadSettings;
+ g_chatApi.DbEventIsShown = DbEventIsShown;
Srmm_CreateHotkey(TABSRMM_HK_SECTION_GENERIC, LPGEN("Send message"));
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index 04045292b2..49743a5544 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -327,7 +327,7 @@ static wchar_t* Template_MakeRelativeDate(HANDLE hTimeZone, time_t check, wchar_
bool DbEventIsShown(const DB::EventInfo &dbei)
{
if (!IsCustomEvent(dbei.eventType) || dbei.isSrmm())
- return 1;
+ return true;
return IsStatusEvent(dbei.eventType);
}
diff --git a/src/core/stdmsg/src/chat_manager.cpp b/src/core/stdmsg/src/chat_manager.cpp
index 4cdd7cbfbd..f7c693b01a 100644
--- a/src/core/stdmsg/src/chat_manager.cpp
+++ b/src/core/stdmsg/src/chat_manager.cpp
@@ -199,6 +199,7 @@ void Load_ChatModule()
g_chatApi.OnFlashWindow = OnFlashWindow;
g_chatApi.OnFlashHighlight = OnFlashHighlight;
g_chatApi.ShowRoom = ShowRoom;
+ g_chatApi.DbEventIsShown = DbEventIsShown;
Srmm_CreateHotkey(LPGEN("Messaging"), LPGEN("Send message"));
diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h
index dc6fdc6c5d..40b2e4b02b 100644
--- a/src/core/stdmsg/src/stdafx.h
+++ b/src/core/stdmsg/src/stdafx.h
@@ -43,32 +43,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <newpluginapi.h>
#include <m_system.h>
-#include <m_database.h>
-#include <m_langpack.h>
+#include <m_avatars.h>
#include <m_button.h>
+#include <m_chat_int.h>
#include <m_clistint.h>
#include <m_clc.h>
-#include <m_gui.h>
-#include <m_options.h>
-#include <m_protosvc.h>
-#include <m_utils.h>
-#include <m_skin.h>
#include <m_contacts.h>
-#include <m_userinfo.h>
+#include <m_database.h>
+#include <m_file.h>
+#include <m_fontservice.h>
+#include <m_gui.h>
#include <m_history.h>
#include <m_hotkeys.h>
-#include <m_chat_int.h>
-#include <m_message.h>
-#include <m_file.h>
#include <m_icolib.h>
-#include <m_fontservice.h>
-#include <m_timezones.h>
-#include <m_avatars.h>
+#include <m_langpack.h>
+#include <m_message.h>
#include <m_metacontacts.h>
-#include <m_ieview.h>
-#include <m_smileyadd.h>
+#include <m_options.h>
#include <m_popup.h>
+#include <m_protosvc.h>
+#include <m_skin.h>
+#include <m_smileyadd.h>
#include <m_srmm_int.h>
+#include <m_timezones.h>
+#include <m_utils.h>
+#include <m_userinfo.h>
/////////////////////////////////////////////////////////////////////////////////////////
// tabs.cpp
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 };