diff options
author | George Hazan <ghazan@miranda.im> | 2023-03-18 17:51:45 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-03-18 17:51:45 +0300 |
commit | 5dd6a8093a3390e52fbddf4ad099c076ebd897c7 (patch) | |
tree | a73d2d978435f179de78920fd3fd3153ab1e5f77 /src | |
parent | 2f44c5207ebad98dbf8d8e5b5d5689f32b01f0dc (diff) |
fixes #3438 (tabSRMM: crash in highlight)
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdmsg/src/chat_manager.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/stdafx.h | 1 | ||||
-rw-r--r-- | src/mir_app/src/chat.h | 2 | ||||
-rw-r--r-- | src/mir_app/src/chat_manager.cpp | 20 | ||||
-rw-r--r-- | src/mir_app/src/chat_opts.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/chat_svc.cpp | 2 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 12 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 12 |
8 files changed, 20 insertions, 33 deletions
diff --git a/src/core/stdmsg/src/chat_manager.cpp b/src/core/stdmsg/src/chat_manager.cpp index b461b91703..d3e0da1969 100644 --- a/src/core/stdmsg/src/chat_manager.cpp +++ b/src/core/stdmsg/src/chat_manager.cpp @@ -208,7 +208,7 @@ void Load_ChatModule() AddIcons();
RegisterFonts();
- CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Message sessions") L"/" LPGENW("Chat module"), FONTMODE_USE, &g_plugin };
+ CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), LPGENW("Message sessions") L"/" LPGENW("Chat module"), FONTMODE_USE, &g_plugin };
Chat_CustomizeApi(&data);
g_chatApi.MM_CreateModule = MM_CreateModule;
diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h index 33d557a6a9..8a8633954b 100644 --- a/src/core/stdmsg/src/stdafx.h +++ b/src/core/stdmsg/src/stdafx.h @@ -128,7 +128,6 @@ CTabbedWindow *GetContainer(); /////////////////////////////////////////////////////////////////////////////////////////
struct MODULEINFO : public GCModuleInfoBase {};
-struct SESSION_INFO : public GCSessionInfoBase {};
struct LOGSTREAMDATA : public GCLogStreamDataBase {};
#include "cmdlist.h"
diff --git a/src/mir_app/src/chat.h b/src/mir_app/src/chat.h index baa328fd99..6604acd027 100644 --- a/src/mir_app/src/chat.h +++ b/src/mir_app/src/chat.h @@ -33,7 +33,7 @@ void CheckChatCompatibility(); class CLogWindow : public CSrmmLogWindow {};
extern HPLUGIN g_pChatPlugin;
-extern int g_cbSession, g_cbModuleInfo, g_iFontMode;
+extern int g_cbModuleInfo, g_iFontMode;
extern wchar_t *g_szFontGroup;
extern mir_cs csChat;
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp index 400eb08aca..c978c6fa9a 100644 --- a/src/mir_app/src/chat_manager.cpp +++ b/src/mir_app/src/chat_manager.cpp @@ -122,15 +122,15 @@ static BOOL LM_RemoveAll(LOGINFO **ppLogListStart, LOGINFO **ppLogListEnd) // Session Manager functions
// Keeps track of all sessions and its windows
-GCSessionInfoBase::GCSessionInfoBase() :
+SESSION_INFO::SESSION_INFO() :
arKeys(10, CompareKeys),
arUsers(10, CompareUser)
{}
-GCSessionInfoBase::~GCSessionInfoBase()
+SESSION_INFO::~SESSION_INFO()
{}
-const char *GCSessionInfoBase::getSoundName(int iEventType) const
+const char* SESSION_INFO::SESSION_INFO::getSoundName(int iEventType) const
{
// if sounds are filtered out for this event type, do nothing;
if (!(db_get_dw(0, CHAT_MODULE, "SoundFlags", GC_EVENT_HIGHLIGHT) & iEventType))
@@ -942,19 +942,6 @@ MIR_APP_DLL(CHAT_MANAGER*) Chat_CustomizeApi(const CHAT_MANAGER_INITDATA *pInit) // wipe out old junk
memset((uint8_t*)&g_chatApi + offsetof(CHAT_MANAGER, OnCreateModule), 0, sizeof(CHAT_MANAGER) - offsetof(CHAT_MANAGER, OnCreateModule));
-
- if (g_cbSession) { // reallocate old sessions
- mir_cslock lck(csChat);
-
- LIST<SESSION_INFO> tmp(g_arSessions);
- g_arSessions.destroy();
-
- for (auto &p : tmp) {
- SESSION_INFO *p1 = (SESSION_INFO*)realloc(p, pInit->cbSession);
- memset((uint8_t*)p1 + sizeof(SESSION_INFO), 0, pInit->cbSession - sizeof(SESSION_INFO));
- g_arSessions.insert(p1);
- }
- }
if (g_cbModuleInfo != pInit->cbModuleInfo) { // reallocate old modules
bool bReallocated = false;
@@ -978,7 +965,6 @@ MIR_APP_DLL(CHAT_MANAGER*) Chat_CustomizeApi(const CHAT_MANAGER_INITDATA *pInit) g_Settings = pInit->pSettings;
g_szFontGroup = pInit->szFontGroup;
- g_cbSession = pInit->cbSession;
g_cbModuleInfo = pInit->cbModuleInfo;
g_iFontMode = pInit->iFontMode;
g_pChatPlugin = pInit->pPlugin;
diff --git a/src/mir_app/src/chat_opts.cpp b/src/mir_app/src/chat_opts.cpp index c6ef12ab41..61f7cbadfc 100644 --- a/src/mir_app/src/chat_opts.cpp +++ b/src/mir_app/src/chat_opts.cpp @@ -30,7 +30,7 @@ HICON g_hChatIcons[20]; uint32_t g_dwDiskLogFlags;
HPLUGIN g_pChatPlugin;
GlobalLogSettingsBase *g_Settings;
-int g_cbSession, g_cbModuleInfo = sizeof(MODULEINFO), g_iFontMode;
+int g_cbModuleInfo = sizeof(MODULEINFO), g_iFontMode;
wchar_t *g_szFontGroup;
#define FONTF_BOLD 1
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp index f4df439417..911a04788d 100644 --- a/src/mir_app/src/chat_svc.cpp +++ b/src/mir_app/src/chat_svc.cpp @@ -259,6 +259,8 @@ MIR_APP_DLL(SESSION_INFO*) Chat_NewSession( else
wcsncpy_s(szTemp, si->ptszName, _TRUNCATE);
si->hContact = AddRoom(pszModule, ptszID, szTemp, si->iType);
+ si->iLogPopupFlags = db_get_dw(0, CHAT_MODULE, "PopupFlags", GC_EVENT_HIGHLIGHT);
+ si->iLogTrayFlags = db_get_dw(0, CHAT_MODULE, "TrayIconFlags", GC_EVENT_HIGHLIGHT);
db_set_s(si->hContact, si->pszModule, "Topic", "");
db_unset(si->hContact, "CList", "StatusMsg");
if (si->ptszStatusbarText)
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index d662635947..b84da6e734 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -582,11 +582,11 @@ g_hevEventFiltered @694 NONAME g_hevMarkedRead @695 NONAME
g_hevSettingChanged @696 NONAME
??0GCModuleInfoBase@@QAE@XZ @697 NONAME
-??0GCSessionInfoBase@@QAE@XZ @698 NONAME
+??0SESSION_INFO@@QAE@XZ @698 NONAME
??1GCModuleInfoBase@@QAE@XZ @699 NONAME
-??1GCSessionInfoBase@@QAE@XZ @700 NONAME
-?getUserList@GCSessionInfoBase@@QAEAAU?$OBJLIST@UUSERINFO@@@@XZ @701 NONAME
-?getMe@GCSessionInfoBase@@QBEPAUUSERINFO@@XZ @702 NONAME
+??1SESSION_INFO@@QAE@XZ @700 NONAME
+?getUserList@SESSION_INFO@@QAEAAU?$OBJLIST@UUSERINFO@@@@XZ @701 NONAME
+?getMe@SESSION_INFO@@QBEPAUUSERINFO@@XZ @702 NONAME
?MetaRemoveSubHistory@MDatabaseCommon@@UAGHPAUDBCachedContact@@@Z @703 NONAME
?MetaRemoveSubHistory@MDatabaseReadonly@@UAGHPAUDBCachedContact@@@Z @704 NONAME
Chat_GetGroup @705
@@ -629,7 +629,7 @@ db_mc_tryMeta @732 ?setUString@PROTO_INTERFACE@@QAEXPBD0@Z @742 NONAME
?setUString@CMPluginBase@@QAEXIPBD0@Z @743 NONAME
?setUString@CMPluginBase@@QAEXPBD0@Z @744 NONAME
-?getKeyList@GCSessionInfoBase@@QAEAAU?$LIST@UUSERINFO@@@@XZ @745 NONAME
+?getKeyList@SESSION_INFO@@QAEAAU?$LIST@UUSERINFO@@@@XZ @745 NONAME
PUAddPopup @746
PUAddPopupW @747
PUChangeTextW @748
@@ -746,7 +746,7 @@ _Netlib_GetTlsUnique@12 @831 NONAME ?TrayAlwaysStatus@Clist@@3V?$CMOption@_N@@A @861 NONAME
?Flush@MDatabaseCommon@@UAGHXZ @862 NONAME
?getIcon@CHAT_MANAGER@@QBGPAUHICON__@@H@Z @863 NONAME
-?getSoundName@GCSessionInfoBase@@QBEPBDH@Z @864 NONAME
+?getSoundName@SESSION_INFO@@QBEPBDH@Z @864 NONAME
?Upgrade@DB@@YGPAVMDatabaseCommon@@PB_W@Z @865 NONAME
?IsPluginOnWhiteList@@YG_NPBD@Z @866 NONAME
?SetPluginOnWhiteList@@YGXPBD_N@Z @867 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index e88cb7f181..91471cf20e 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -582,11 +582,11 @@ g_hevEventFiltered @694 NONAME g_hevMarkedRead @695 NONAME
g_hevSettingChanged @696 NONAME
??0GCModuleInfoBase@@QEAA@XZ @697 NONAME
-??0GCSessionInfoBase@@QEAA@XZ @698 NONAME
+??0SESSION_INFO@@QEAA@XZ @698 NONAME
??1GCModuleInfoBase@@QEAA@XZ @699 NONAME
-??1GCSessionInfoBase@@QEAA@XZ @700 NONAME
-?getUserList@GCSessionInfoBase@@QEAAAEAU?$OBJLIST@UUSERINFO@@@@XZ @701 NONAME
-?getMe@GCSessionInfoBase@@QEBAPEAUUSERINFO@@XZ @702 NONAME
+??1SESSION_INFO@@QEAA@XZ @700 NONAME
+?getUserList@SESSION_INFO@@QEAAAEAU?$OBJLIST@UUSERINFO@@@@XZ @701 NONAME
+?getMe@SESSION_INFO@@QEBAPEAUUSERINFO@@XZ @702 NONAME
?MetaRemoveSubHistory@MDatabaseCommon@@UEAAHPEAUDBCachedContact@@@Z @703 NONAME
?MetaRemoveSubHistory@MDatabaseReadonly@@UEAAHPEAUDBCachedContact@@@Z @704 NONAME
Chat_GetGroup @705
@@ -629,7 +629,7 @@ db_mc_tryMeta @732 ?setUString@PROTO_INTERFACE@@QEAAXPEBD0@Z @742 NONAME
?setUString@CMPluginBase@@QEAAXIPEBD0@Z @743 NONAME
?setUString@CMPluginBase@@QEAAXPEBD0@Z @744 NONAME
-?getKeyList@GCSessionInfoBase@@QEAAAEAU?$LIST@UUSERINFO@@@@XZ @745 NONAME
+?getKeyList@SESSION_INFO@@QEAAAEAU?$LIST@UUSERINFO@@@@XZ @745 NONAME
PUAddPopup @746
PUAddPopupW @747
PUChangeTextW @748
@@ -746,7 +746,7 @@ Netlib_GetTlsUnique @831 NONAME ?TrayAlwaysStatus@Clist@@3V?$CMOption@_N@@A @861 NONAME
?Flush@MDatabaseCommon@@UEAAHXZ @862 NONAME
?getIcon@CHAT_MANAGER@@QEBAPEAUHICON__@@H@Z @863 NONAME
-?getSoundName@GCSessionInfoBase@@QEBAPEBDH@Z @864 NONAME
+?getSoundName@SESSION_INFO@@QEBAPEBDH@Z @864 NONAME
?Upgrade@DB@@YAPEAVMDatabaseCommon@@PEB_W@Z @865 NONAME
?IsPluginOnWhiteList@@YA_NPEBD@Z @866 NONAME
?SetPluginOnWhiteList@@YAXPEBD_N@Z @867 NONAME
|