summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-10-29 19:17:58 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-10-29 19:17:58 +0300
commit5178dcc3862b9dca2a59f3824a3dab74b217f3ba (patch)
tree56d29c3074cee86036c43771a8d4d4e4eecd14ed /plugins/TabSRMM/src
parent08d4acbb33f69c9bb0dcb4255785367f631c0e95 (diff)
two more flags removed
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r--plugins/TabSRMM/src/chat_log.cpp5
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp4
-rw-r--r--plugins/TabSRMM/src/msgdlgother.cpp2
-rw-r--r--plugins/TabSRMM/src/msglog.cpp6
-rw-r--r--plugins/TabSRMM/src/msgs.h14
-rw-r--r--plugins/TabSRMM/src/utils.cpp1
6 files changed, 13 insertions, 19 deletions
diff --git a/plugins/TabSRMM/src/chat_log.cpp b/plugins/TabSRMM/src/chat_log.cpp
index 302ff08645..50bb6bcea9 100644
--- a/plugins/TabSRMM/src/chat_log.cpp
+++ b/plugins/TabSRMM/src/chat_log.cpp
@@ -413,15 +413,14 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData)
if (lin->next != nullptr)
str.Append("\\par ");
- if (streamData->dat->m_dwFlags & MWF_DIVIDERWANTED || lin->dwFlags & MWF_DIVIDERWANTED) {
+ if (streamData->dat->m_bDividerWanted) {
static char szStyle_div[128] = "\0";
if (szStyle_div[0] == 0)
mir_snprintf(szStyle_div, "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", 17, 18, 0, 0, 5);
- lin->dwFlags |= MWF_DIVIDERWANTED;
if (lin->prev || !streamData->bRedraw)
str.AppendFormat("\\qc\\sl-1\\highlight%d %s ---------------------------------------------------------------------------------------\\par ", 18, szStyle_div);
- streamData->dat->m_dwFlags &= ~MWF_DIVIDERWANTED;
+ streamData->dat->m_bDividerWanted = false;
}
// create new line, and set font and color
str.AppendFormat("\\ql\\sl0%s ", g_chatApi.Log_SetStyle(0));
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index 08c9ba6b91..c51de0aa12 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -1075,9 +1075,9 @@ int CMsgDialog::DM_SplitterGlobalEvent(WPARAM wParam, LPARAM lParam)
void CMsgDialog::DM_AddDivider()
{
- if (!(m_dwFlags & MWF_DIVIDERSET) && PluginConfig.m_bUseDividers) {
+ if (!m_bDividerSet && PluginConfig.m_bUseDividers) {
if (GetWindowTextLength(m_pLog->GetHwnd()) > 0)
- m_dwFlags |= MWF_DIVIDERWANTED | MWF_DIVIDERSET;
+ m_bDividerSet = m_bDividerWanted = true;
}
}
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp
index 4e4760bce7..5c88229539 100644
--- a/plugins/TabSRMM/src/msgdlgother.cpp
+++ b/plugins/TabSRMM/src/msgdlgother.cpp
@@ -2225,7 +2225,7 @@ void CMsgDialog::UpdateWindowState(UINT msg)
m_pContainer->m_hwndSaved = m_hwnd;
m_dwTickLastEvent = 0;
- m_dwFlags &= ~MWF_DIVIDERSET;
+ m_bDividerSet = false;
if (m_pContainer->m_dwFlashingStarted != 0) {
FlashContainer(m_pContainer, 0, 0);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index 20df0dfbe8..bb4aefcfae 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -487,19 +487,21 @@ static char* Template_CreateRTFFromDbEvent(CMsgDialog *dat, MCONTACT hContact, M
g_groupBreak = TRUE;
- if (dwEffectiveFlags & MWF_DIVIDERWANTED) {
+ if (dat->m_bDividerWanted) {
static char szStyle_div[128] = "\0";
if (szStyle_div[0] == 0)
mir_snprintf(szStyle_div, "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", H_MSGFONTID_DIVIDERS, H_MSGFONTID_DIVIDERS, 0, 0, 5);
str.AppendFormat("\\sl-1\\slmult0\\highlight%d\\cf%d\\-\\par\\sl0", H_MSGFONTID_DIVIDERS, H_MSGFONTID_DIVIDERS);
- dat->m_dwFlags &= ~MWF_DIVIDERWANTED;
+ dat->m_bDividerWanted = false;
}
+
if (dwEffectiveFlags & MWF_LOG_GROUPMODE && ((dbei.flags & (DBEF_SENT | DBEF_READ | DBEF_RTL)) == LOWORD(dat->m_iLastEventType)) && dbei.eventType == EVENTTYPE_MESSAGE && HIWORD(dat->m_iLastEventType) == EVENTTYPE_MESSAGE && (dbei.timestamp - dat->m_lastEventTime) < 86400) {
g_groupBreak = FALSE;
if ((time_t)dbei.timestamp > today && dat->m_lastEventTime < today)
g_groupBreak = TRUE;
}
+
if (!streamData->isEmpty && g_groupBreak && (dwEffectiveFlags & MWF_LOG_GRID))
str.AppendFormat("\\sl-1\\slmult0\\highlight%d\\cf%d\\-\\par\\sl0", MSGDLGFONTCOUNT + 4, MSGDLGFONTCOUNT + 4);
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h
index 792a4d83ff..28ce4e8503 100644
--- a/plugins/TabSRMM/src/msgs.h
+++ b/plugins/TabSRMM/src/msgs.h
@@ -40,29 +40,22 @@
#define CONTAINER_NAMELEN 25
#define TITLE_FORMATLEN 30
+#define MWF_LOG_BBCODE 1
+#define MWF_LOG_LOCALTIME 64
#define MWF_LOG_NORMALTEMPLATES 512
#define MWF_LOG_SHOWTIME 1024
#define MWF_LOG_SHOWSECONDS 2048
#define MWF_LOG_SHOWDATES 4096
-
+#define MWF_LOG_NEWLINE 8192
#define MWF_LOG_INDENT 16384
#define MWF_LOG_RTL 32768
-
-// ieview still mistakenly uses these...
-#define MWF_LOG_NEWLINE 8192
#define MWF_LOG_UNDERLINE 65536
#define MWF_LOG_SWAPNICK 131072
-
-#define MWF_LOG_BBCODE 1
-#define MWF_LOG_LOCALTIME 64
-
#define MWF_LOG_SHOWICONS 262144
#define MWF_LOG_SYMBOLS 0x200000
-#define MWF_DIVIDERSET 0x1000000
#define MWF_LOG_TEXTFORMAT 0x2000000
#define MWF_LOG_GRID 0x4000000
#define MWF_LOG_INOUTICONS 0x10000000
-#define MWF_DIVIDERWANTED 0x40000000
#define MWF_LOG_GROUPMODE 0x80000000
#define SMODE_DEFAULT 0
@@ -467,6 +460,7 @@ public:
bool m_bShowAvatar;
bool m_bSaveBtn, m_bNeedCheckSize;
bool m_bErrorState;
+ bool m_bDividerWanted, m_bDividerSet;
bool m_bSplitterOverride;
int m_sendMode;
HKL m_hkl; // keyboard layout identifier
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp
index 17fd247df8..aa6e723da9 100644
--- a/plugins/TabSRMM/src/utils.cpp
+++ b/plugins/TabSRMM/src/utils.cpp
@@ -28,7 +28,6 @@
#include "stdafx.h"
-#define MWF_LOG_BBCODE 1
#define MWF_LOG_TEXTFORMAT 0x2000000
#define MSGDLGFONTCOUNT 22