diff options
author | George Hazan <ghazan@miranda.im> | 2023-04-19 20:25:08 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-04-19 20:25:08 +0300 |
commit | bd1545cafd2da7fa2ce5c64c73ec79766dc9e53c (patch) | |
tree | 7e60d0c6635e039c276563eed9407b97ed80aa1b | |
parent | d023a824d07d23902e0406b86af0af5fda309765 (diff) |
StdMsg: minor code cleaning
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 28 | ||||
-rw-r--r-- | src/core/stdmsg/src/msglog.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgs.cpp | 1 |
3 files changed, 16 insertions, 15 deletions
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 7c87170fcc..492af0aede 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -166,20 +166,6 @@ bool CMsgDialog::OnInitDialog() OnOptionsApplied(false);
- // restore saved msg if any...
- if (m_hContact) {
- DBVARIANT dbv;
- if (!db_get_ws(m_hContact, SRMSGMOD, DBSAVEDMSG, &dbv)) {
- if (dbv.pwszVal[0]) {
- m_message.SetText(dbv.pwszVal);
- m_btnOk.Enable(true);
- UpdateReadChars();
- PostMessage(m_message.GetHwnd(), EM_SETSEL, -1, -1);
- }
- db_free(&dbv);
- }
- }
-
uint32_t dwFlags = SWP_NOMOVE | SWP_NOSIZE;
if (!g_Settings.bTabsEnable)
dwFlags |= SWP_SHOWWINDOW;
@@ -197,6 +183,20 @@ bool CMsgDialog::OnInitDialog() UpdateAvatar();
}
+ // restore saved msg if any...
+ if (m_hContact) {
+ DBVARIANT dbv;
+ if (!db_get_ws(m_hContact, SRMSGMOD, DBSAVEDMSG, &dbv)) {
+ if (dbv.pwszVal[0]) {
+ m_message.SetText(dbv.pwszVal);
+ m_btnOk.Enable(true);
+ UpdateReadChars();
+ PostMessage(m_message.GetHwnd(), EM_SETSEL, -1, -1);
+ }
+ db_free(&dbv);
+ }
+ }
+
NotifyEvent(MSG_WINDOW_EVT_OPEN);
return true;
}
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 6331b6ec30..4e69be9a09 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -290,7 +290,7 @@ public: buf.Append("\\f0\\fs14");
buf.Append(pLogIconBmpBits[i]);
- if (dbei.eventType == EVENTTYPE_MESSAGE && dbei.flags & (DBEF_SECURE | DBEF_SECURE_STRONG)) {
+ if ((dbei.eventType == EVENTTYPE_MESSAGE || dbei.eventType == EVENTTYPE_FILE) && dbei.flags & (DBEF_SECURE | DBEF_SECURE_STRONG)) {
buf.Append("\\f0\\fs14");
buf.Append(pLogIconBmpBits[dbei.flags & DBEF_SECURE ? 3 : 4]);
}
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index c0e216c262..88cf6f656a 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -509,6 +509,7 @@ int LoadSendRecvMessageModule(void) HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
HookEvent(ME_DB_EVENT_ADDED, MessageEventAdded);
+ HookEvent(ME_DB_EVENT_EDITED, MessageEventAdded);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, MessageSettingChanged);
HookEvent(ME_DB_CONTACT_DELETED, ContactDeleted);
HookEvent(ME_OPT_INITIALISE, OptInitialise);
|