summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-25 22:42:55 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-25 22:42:55 +0300
commita8e607794ee84ec965bbaa0df5f97f0d6340e158 (patch)
treebfcf6a4ca5dc37e15756b9f2b0535e71f5e987de /src/core
parent0fe75288b23a76dae6f3e357ff73613edcac47a5 (diff)
StdMsg:
- useless message DM_APPENDTOLOG removed; - fixes #1378
Diffstat (limited to 'src/core')
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp20
-rw-r--r--src/core/stdmsg/src/msgs.h1
2 files changed, 10 insertions, 11 deletions
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 5bfcb1f191..df51991328 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -1129,10 +1129,6 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
}
return TRUE;
- case DM_APPENDTOLOG:
- StreamInEvents(wParam, 1, 1);
- break;
-
case DM_REMAKELOG:
StreamInEvents(m_hDbEventFirst, -1, 0);
break;
@@ -1146,10 +1142,11 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
DBEVENTINFO dbei = {};
db_event_get(hDbEvent, &dbei);
bool isMessage = (dbei.eventType == EVENTTYPE_MESSAGE), isSent = ((dbei.flags & DBEF_SENT) != 0);
+ bool isActive = GetActiveWindow() == m_pOwner->GetHwnd() && GetForegroundWindow() == m_pOwner->GetHwnd();
if (DbEventIsShown(&dbei)) {
// Sounds *only* for sent messages, not for custom events
if (isMessage && !isSent) {
- if (GetForegroundWindow() == m_pOwner->GetHwnd())
+ if (isActive)
Skin_PlaySound("RecvMsgActive");
else
Skin_PlaySound("RecvMsgInactive");
@@ -1158,14 +1155,17 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
m_lastMessage = dbei.timestamp;
UpdateLastMessage();
}
- if (hDbEvent != m_hDbEventFirst && db_event_next(m_hContact, hDbEvent) == 0)
- SendMessage(m_hwnd, DM_APPENDTOLOG, hDbEvent, 0);
- else
- SendMessage(m_hwnd, DM_REMAKELOG, 0, 0);
+
+ if (isActive) {
+ if (hDbEvent != m_hDbEventFirst && db_event_next(m_hContact, hDbEvent) == 0)
+ StreamInEvents(hDbEvent, 1, 1);
+ else
+ SendMessage(m_hwnd, DM_REMAKELOG, 0, 0);
+ }
// Flash window *only* for messages, not for custom events
if (isMessage && !isSent) {
- if (GetActiveWindow() == m_pOwner->GetHwnd() && GetForegroundWindow() == m_pOwner->GetHwnd()) {
+ if (isActive) {
if (GetWindowLongPtr(m_log.GetHwnd(), GWL_STYLE) & WS_VSCROLL) {
SCROLLINFO si = {};
si.cbSize = sizeof(si);
diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h
index 07917e2736..462d485ecb 100644
--- a/src/core/stdmsg/src/msgs.h
+++ b/src/core/stdmsg/src/msgs.h
@@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define DM_OPTIONSAPPLIED (WM_USER+14)
#define DM_CLOSETAB (WM_USER+15)
#define DM_UPDATETITLE (WM_USER+16)
-#define DM_APPENDTOLOG (WM_USER+17)
#define DM_NEWTIMEZONE (WM_USER+18)
#define DM_TYPING (WM_USER+20)
#define DM_UPDATEWINICON (WM_USER+21)