diff options
Diffstat (limited to 'plugins/Scriver/src/msgutils.cpp')
-rw-r--r-- | plugins/Scriver/src/msgutils.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/plugins/Scriver/src/msgutils.cpp b/plugins/Scriver/src/msgutils.cpp index 01210cdcbd..4df469e568 100644 --- a/plugins/Scriver/src/msgutils.cpp +++ b/plugins/Scriver/src/msgutils.cpp @@ -36,6 +36,45 @@ void CMsgDialog::CloseTab() Close(); } +void CMsgDialog::EventAdded(MEVENT hDbEvent, const DBEVENTINFO &dbei) +{ + if (m_hDbEventFirst == 0) + m_hDbEventFirst = hDbEvent; + + if (DbEventIsShown(dbei)) { + bool bIsActive = IsActive(); + if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & (DBEF_SENT))) { + /* store the event when the container is hidden so that clist notifications can be removed */ + if (!IsWindowVisible(m_hwndParent) && m_hDbUnreadEventFirst == 0) + m_hDbUnreadEventFirst = hDbEvent; + m_lastMessage = dbei.timestamp; + UpdateStatusBar(); + if (bIsActive) + Skin_PlaySound("RecvMsgActive"); + else + Skin_PlaySound("RecvMsgInactive"); + if (g_dat.flags2.bSwitchToActive && (IsIconic(m_hwndParent) || GetActiveWindow() != m_hwndParent) && IsWindowVisible(m_hwndParent)) + m_pParent->ActivateChild(this); + if (IsAutoPopup(m_hContact)) + PopupWindow(true); + } + + if (hDbEvent != m_hDbEventFirst && db_event_next(m_hContact, hDbEvent) == 0) + m_pLog->LogEvents(hDbEvent, 1, 1); + else + SendMessage(m_hwnd, DM_REMAKELOG, 0, 0); + + if (!(dbei.flags & DBEF_SENT) && !DbEventIsCustomForMsgWindow(&dbei)) { + if (!bIsActive) { + m_iShowUnread = 1; + UpdateIcon(); + SetTimer(m_hwnd, TIMERID_UNREAD, TIMEOUT_UNREAD, nullptr); + } + StartFlashing(); + } + } +} + bool CMsgDialog::GetFirstEvent() { bool notifyUnread = false; |