From dce9f354b8a42a1646772272639d1821f9763bb5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 1 Jun 2023 19:17:51 +0300 Subject: =?UTF-8?q?fixes=20#3533=20(OMEMO:=20=D0=BF=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=BD=D0=B5=D1=81=D1=82=D0=B8=20=D0=BA=D0=BE=D0=B4,=20=D1=80?= =?UTF-8?q?=D0=B8=D1=81=D1=83=D1=8E=D1=89=D0=B8=D0=B9=20=D1=81=D1=82=D0=B0?= =?UTF-8?q?=D1=82=D1=83=D1=81=20OMEMO=20=D0=B2=20=D0=B4=D1=80=D1=83=D0=B3?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=BF=D0=BB=D0=B0=D0=B3=D0=B8=D0=BD=D1=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/TabSRMM/src/globals.h | 2 +- plugins/TabSRMM/src/msglog.cpp | 29 +++++++++++++++++++---------- plugins/TabSRMM/src/msgs.cpp | 4 +++- plugins/TabSRMM/src/msgs.h | 1 - 4 files changed, 23 insertions(+), 13 deletions(-) (limited to 'plugins/TabSRMM/src') diff --git a/plugins/TabSRMM/src/globals.h b/plugins/TabSRMM/src/globals.h index db6229428e..004377dfce 100644 --- a/plugins/TabSRMM/src/globals.h +++ b/plugins/TabSRMM/src/globals.h @@ -64,7 +64,7 @@ public: const HMENU getMenuBar(); HWND g_hwndHotkeyHandler; - HICON g_iconIn, g_iconOut, g_iconErr, g_iconContainer, g_iconStatus; + HICON g_iconIn, g_iconOut, g_iconErr, g_iconContainer, g_iconStatus, g_iconSecure, g_iconStrong; HICON g_iconOverlayDisabled, g_iconOverlayEnabled, g_iconClock; HCURSOR hCurSplitNS, hCurSplitWE, hCurSplitSW, hCurSplitWSE; HBITMAP g_hbmUnknown; diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 84967831e1..8e3a2fab60 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -70,15 +70,18 @@ char *rtfFonts; LOGFONTW logfonts[MSGDLGFONTCOUNT + 2]; COLORREF fontcolors[MSGDLGFONTCOUNT + 2]; -#define LOGICON_MSG 0 -#define LOGICON_URL 1 -#define LOGICON_FILE 2 -#define LOGICON_OUT 3 -#define LOGICON_IN 4 +#define LOGICON_MSG 0 +#define LOGICON_URL 1 +#define LOGICON_FILE 2 +#define LOGICON_OUT 3 +#define LOGICON_IN 4 #define LOGICON_STATUS 5 -#define LOGICON_ERROR 6 +#define LOGICON_ERROR 6 +#define LOGICON_SECURE 7 +#define LOGICON_STRONG 8 +#define LOGICON_MAX 9 -static HICON Logicons[NR_LOGICONS]; +static HICON Logicons[LOGICON_MAX]; struct RtfLogStreamData : public RtfLogStreamBase { @@ -160,6 +163,8 @@ void TSAPI CacheMsgLogIcons() Logicons[4] = PluginConfig.g_iconIn; Logicons[5] = PluginConfig.g_iconStatus; Logicons[6] = PluginConfig.g_iconErr; + Logicons[7] = PluginConfig.g_iconSecure; + Logicons[8] = PluginConfig.g_iconStrong; } struct TLogIcon @@ -735,8 +740,12 @@ bool CLogWindow::CreateRtfEvent(RtfLogStreamData *streamData, DB::EventInfo &dbe case 'I': if (dwEffectiveFlags & MWF_LOG_SHOWICONS) { int icon; - if ((dwEffectiveFlags & MWF_LOG_INOUTICONS) && dbei.eventType == EVENTTYPE_MESSAGE) - icon = isSent ? LOGICON_OUT : LOGICON_IN; + if ((dwEffectiveFlags & MWF_LOG_INOUTICONS) && dbei.eventType == EVENTTYPE_MESSAGE) { + if (dbei.flags & (DBEF_SECURE | DBEF_SECURE_STRONG)) + icon = (dbei.flags & DBEF_SECURE) ? LOGICON_SECURE : LOGICON_STRONG; + else + icon = isSent ? LOGICON_OUT : LOGICON_IN; + } else { switch (dbei.eventType) { case EVENTTYPE_FILE: @@ -1432,7 +1441,7 @@ void CLogWindow::ReplaceIcons(LONG startAt, int fAppend, BOOL isSent) m_rtf.SendMsg(EM_GETTEXTRANGE, 0, (LPARAM)&tr); int bIconIndex = trbuffer[0] - '0'; - if (bIconIndex >= NR_LOGICONS) { + if (bIconIndex >= LOGICON_MAX) { fi.chrg.cpMin = fi.chrgText.cpMax + 6; continue; } diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 1c4448bff0..ce2d585d10 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -467,7 +467,9 @@ static TIconDesc _logicons[] = { "tabSRMM_error", LPGEN("Message delivery error"), &PluginConfig.g_iconErr, -IDI_MSGERROR, 1 }, { "tabSRMM_in", LPGEN("Incoming message"), &PluginConfig.g_iconIn, -IDI_ICONIN, 0 }, { "tabSRMM_out", LPGEN("Outgoing message"), &PluginConfig.g_iconOut, -IDI_ICONOUT, 0 }, - { "tabSRMM_status", LPGEN("Status change"), &PluginConfig.g_iconStatus, -IDI_STATUSCHANGE, 0 } + { "tabSRMM_status", LPGEN("Status change"), &PluginConfig.g_iconStatus, -IDI_STATUSCHANGE, 0 }, + { "tabSRMM_secure", LPGEN("Secure message"), &PluginConfig.g_iconSecure, -IDI_SECURE, 0 }, + { "tabSRMM_strong", LPGEN("Secure message (verified)"), &PluginConfig.g_iconStrong, -IDI_STRONG, 0 }, }; static TIconDesc _deficons[] = diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index 69582f562d..b0104e83b6 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -170,7 +170,6 @@ struct TitleBtn { #define BTN_MAX 1 #define BTN_CLOSE 2 -#define NR_LOGICONS 7 #define NR_BUTTONBARICONS 37//MaD: 29 class CContactCache; -- cgit v1.2.3