diff options
author | George Hazan <ghazan@miranda.im> | 2018-10-13 23:47:14 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-10-13 23:47:14 +0300 |
commit | 27a552b8bf0f42af225e07b009d5b3e9c633e3fe (patch) | |
tree | 2a2b3204955b92e9cf87aed76a7033067a050ecd /src/mir_app | |
parent | 31af9f2c6205e0517185f71c6c66f76d6425e2a5 (diff) |
group chats:
- GC_SHAREDUSERS removed;
- SESSION_INFO::pParent used instead to collect data about shared user info
- fix for SESSION_INFO::pMe calculation
- Discord chats now go offline when proto goes offline
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/chat_manager.cpp | 10 | ||||
-rw-r--r-- | src/mir_app/src/chat_svc.cpp | 1 | ||||
-rw-r--r-- | src/mir_app/src/chat_tools.cpp | 8 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 1 |
5 files changed, 12 insertions, 9 deletions
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp index 4abff39ba8..b7404c1e4c 100644 --- a/src/mir_app/src/chat_manager.cpp +++ b/src/mir_app/src/chat_manager.cpp @@ -512,8 +512,7 @@ static void SM_InvalidateLogDirectories() // Module Manager functions
// Necessary to keep track of all modules that has registered with the plugin
-GCModuleInfoBase::GCModuleInfoBase() :
- arUsers(1, CompareUser)
+GCModuleInfoBase::GCModuleInfoBase()
{}
GCModuleInfoBase::~GCModuleInfoBase()
@@ -843,13 +842,12 @@ BOOL UM_RemoveAll(SESSION_INFO *si) if (!si)
return FALSE;
- if (!si->pMI->bSharedUsers) {
- auto &arUsers = si->getUserList();
- for (auto &ui : arUsers) {
+ if (!si->pParent) {
+ for (auto &ui : si->arUsers) {
mir_free(ui->pszUID);
mir_free(ui->pszNick);
}
- arUsers.destroy();
+ si->arUsers.destroy();
}
return TRUE;
}
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp index c9e20939c5..55d2e56db8 100644 --- a/src/mir_app/src/chat_svc.cpp +++ b/src/mir_app/src/chat_svc.cpp @@ -170,7 +170,6 @@ MIR_APP_DLL(int) Chat_Register(const GCREGISTER *gcr) mi->bBkgColor = (gcr->dwFlags & GC_BKGCOLOR) != 0;
mi->bAckMsg = (gcr->dwFlags & GC_ACKMSG) != 0;
mi->bChanMgr = (gcr->dwFlags & GC_CHANMGR) != 0;
- mi->bSharedUsers = (gcr->dwFlags & GC_SHAREDUSERS) != 0;
mi->iMaxText = gcr->iMaxText;
mi->pszHeader = g_chatApi.Log_CreateRtfHeader();
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index 9ac61b5ae7..8bc297ec50 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -360,12 +360,16 @@ static wchar_t szTrimString[] = L":,.!?;\'>)"; bool IsHighlighted(SESSION_INFO *si, GCEVENT *gce)
{
- if (!g_Settings->bHighlightEnabled || !g_Settings->pszHighlightWords || !gce || !si || !si->pMe)
+ if (!g_Settings->bHighlightEnabled || !g_Settings->pszHighlightWords || !gce || !si)
return FALSE;
if (gce->ptszText == nullptr)
return FALSE;
+ USERINFO *pMe = si->getMe();
+ if (pMe == nullptr)
+ return FALSE;
+
wchar_t *buf = RemoveFormatting(NEWWSTR_ALLOCA(gce->ptszText));
int iStart = 0;
@@ -378,7 +382,7 @@ bool IsHighlighted(SESSION_INFO *si, GCEVENT *gce) // replace %m with the users nickname
if (tszToken == L"%m")
- tszToken = si->pMe->pszNick;
+ tszToken = pMe->pszNick;
if (tszToken.Find('*') == -1)
tszToken = '*' + tszToken + '*';
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 25c27789a7..7bbe2c533e 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -666,3 +666,4 @@ g_hevSettingChanged @696 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
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 3c09b922e7..c7260c9440 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -666,3 +666,4 @@ g_hevSettingChanged @696 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
|