diff options
author | George Hazan <george.hazan@gmail.com> | 2023-06-01 19:17:51 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-06-01 19:17:51 +0300 |
commit | dce9f354b8a42a1646772272639d1821f9763bb5 (patch) | |
tree | 78cab61be0e72e4861e3bcb1dc91ba58b114b40d /plugins/TabSRMM | |
parent | 117dc56ff0d9a32feb0531c066bcff58a2ec4229 (diff) |
fixes #3533 (OMEMO: перенести код, рисующий статус OMEMO в другие плагины)
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/TabSRMM_icons/NOVA/res/ICONS_NOVA.rc | 3 | ||||
-rw-r--r-- | plugins/TabSRMM/TabSRMM_icons/NOVA/res/private.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/TabSRMM/TabSRMM_icons/NOVA/res/unverified.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/TabSRMM/TabSRMM_icons/resource.h | 6 | ||||
-rw-r--r-- | plugins/TabSRMM/src/globals.h | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msglog.cpp | 29 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.h | 1 |
8 files changed, 29 insertions, 16 deletions
diff --git a/plugins/TabSRMM/TabSRMM_icons/NOVA/res/ICONS_NOVA.rc b/plugins/TabSRMM/TabSRMM_icons/NOVA/res/ICONS_NOVA.rc index d256512598..3bcec338fc 100644 --- a/plugins/TabSRMM/TabSRMM_icons/NOVA/res/ICONS_NOVA.rc +++ b/plugins/TabSRMM/TabSRMM_icons/NOVA/res/ICONS_NOVA.rc @@ -73,6 +73,8 @@ IDI_SESSIONLIST ICON "slist.ico" IDI_CONFIGSIDEBAR ICON "sbaroptions.ico"
IDI_RECENTLIST ICON "recentlist.ico"
IDI_USERPREFS ICON "userprefs.ico"
+IDI_SECURE ICON "unverified.ico"
+IDI_STRONG ICON "private.ico"
IDI_TOPICBUT ICON "chat\\topicbut.ico"
IDI_JOIN ICON "chat\\join.ico"
@@ -99,7 +101,6 @@ IDI_FILTER2 ICON "chat\\filter2.ico" IDI_SHOWNICKLIST ICON "chat\\nicklist_show.ico"
IDI_HIDENICKLIST ICON "chat\\nicklist_hide.ico"
-
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
diff --git a/plugins/TabSRMM/TabSRMM_icons/NOVA/res/private.ico b/plugins/TabSRMM/TabSRMM_icons/NOVA/res/private.ico Binary files differnew file mode 100644 index 0000000000..ff23d39b5f --- /dev/null +++ b/plugins/TabSRMM/TabSRMM_icons/NOVA/res/private.ico diff --git a/plugins/TabSRMM/TabSRMM_icons/NOVA/res/unverified.ico b/plugins/TabSRMM/TabSRMM_icons/NOVA/res/unverified.ico Binary files differnew file mode 100644 index 0000000000..0595776a28 --- /dev/null +++ b/plugins/TabSRMM/TabSRMM_icons/NOVA/res/unverified.ico diff --git a/plugins/TabSRMM/TabSRMM_icons/resource.h b/plugins/TabSRMM/TabSRMM_icons/resource.h index 180af77975..343e6f2ead 100644 --- a/plugins/TabSRMM/TabSRMM_icons/resource.h +++ b/plugins/TabSRMM/TabSRMM_icons/resource.h @@ -34,9 +34,11 @@ #define IDI_ICONOUT 111 /* outgoing message icon */
#define IDI_STATUSCHANGE 112 /* status changes */
#define IDI_MSGERROR 113 /* error message */
+#define IDI_SECURE 114 /* encrypted message */
+#define IDI_STRONG 115 /* strongly encrypted message */
-// misc icons, status bar etc.
-
+ // misc icons, status bar etc.
+
#define IDI_SELFTYPING_ON 130 /* sending typing notify is on */
#define IDI_SELFTYPING_OFF 131 /* sending typing notify is off */
#define IDI_SECUREIM_ENABLED 132 /* connection is secured via secureim */
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;
|