From 9774715b1914ac65ada1211322bfd080af694af9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 24 Mar 2024 15:22:00 +0300 Subject: code cleaning --- plugins/Scriver/src/msgdialog.cpp | 4 ++-- plugins/Scriver/src/msglog.cpp | 9 --------- plugins/Scriver/src/msgs.cpp | 4 ++-- plugins/Scriver/src/msgs.h | 1 - plugins/Scriver/src/msgutils.cpp | 2 +- 5 files changed, 5 insertions(+), 15 deletions(-) (limited to 'plugins/Scriver/src') diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 55e47e594d..426ff11eab 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -381,7 +381,7 @@ void CMsgDialog::onClick_Quote(CCtrlButton*) if (!dbei) return; - if (DbEventIsMessageOrCustom(dbei)) { + if (dbei.isSrmm()) { ptrW wszText(DbEvent_GetTextW(&dbei)); SetMessageText(Srmm_Quote(wszText)); } @@ -910,7 +910,7 @@ INT_PTR CMsgDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) m_hDbUnreadEventFirst = 0; while (hDbEvent != 0) { DB::EventInfo dbei(hDbEvent, false); - if (!(dbei.flags & DBEF_SENT) && DbEventIsMessageOrCustom(dbei)) + if (!(dbei.flags & DBEF_SENT) && dbei.isSrmm()) Clist_RemoveEvent(-1, hDbEvent); hDbEvent = db_event_next(m_hContact, hDbEvent); } diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index cf68b2a7cc..f5566ea31c 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -39,18 +39,9 @@ struct RtfLogStreamData : public RtfLogStreamBase GlobalMessageData *gdat; }; -bool DbEventIsMessageOrCustom(const DB::EventInfo &dbei) -{ - return dbei.eventType == EVENTTYPE_MESSAGE || dbei.eventType == EVENTTYPE_FILE || dbei.isSrmm(); -} - bool DbEventIsShown(const DB::EventInfo &dbei) { switch (dbei.eventType) { - case EVENTTYPE_MESSAGE: - case EVENTTYPE_FILE: - return 1; - case EVENTTYPE_JABBER_CHATSTATES: case EVENTTYPE_JABBER_PRESENCE: return 0; diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index 1ed017280d..799dc68cec 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -124,7 +124,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDbEvent) if (dbei.eventType == EVENTTYPE_MESSAGE && (dbei.flags & DBEF_READ)) return 0; - if (dbei.flags & DBEF_SENT || !DbEventIsMessageOrCustom(dbei)) + if (dbei.flags & DBEF_SENT || !dbei.isSrmm()) return 0; Utils_InvokeAsync(new CAutoPpopup(hContact, hDbEvent)); @@ -256,7 +256,7 @@ static void RestoreUnreadMessageAlerts(void) DB::EventInfo dbei(hDbEvent, false); if (!dbei) continue; - if (dbei.markedRead() || !DbEventIsMessageOrCustom(dbei) || !Proto_GetBaseAccountName(hContact)) + if (dbei.markedRead() || !dbei.isSrmm() || !Proto_GetBaseAccountName(hContact)) continue; int windowAlreadyExists = Srmm_FindWindow(hContact) != nullptr; diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index 78f75add4f..28ec396099 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -192,7 +192,6 @@ public: #define EVENTTYPE_JABBER_PRESENCE 2001 bool DbEventIsShown(const DB::EventInfo &dbei); -bool DbEventIsMessageOrCustom(const DB::EventInfo &dbei); void LoadMsgLogIcons(void); void FreeMsgLogIcons(void); int IsAutoPopup(MCONTACT hContact); diff --git a/plugins/Scriver/src/msgutils.cpp b/plugins/Scriver/src/msgutils.cpp index 2132d124f4..9167a4f3dd 100644 --- a/plugins/Scriver/src/msgutils.cpp +++ b/plugins/Scriver/src/msgutils.cpp @@ -122,7 +122,7 @@ bool CMsgDialog::GetFirstEvent() m_hDbEventFirst = db_event_firstUnread(m_hContact); if (m_hDbEventFirst != 0) { DB::EventInfo dbei(m_hDbEventFirst, false); - if (DbEventIsMessageOrCustom(dbei) && !(dbei.flags & DBEF_READ) && !(dbei.flags & DBEF_SENT)) + if (dbei.isSrmm() && !(dbei.flags & DBEF_READ) && !(dbei.flags & DBEF_SENT)) notifyUnread = true; } -- cgit v1.2.3