diff options
author | George Hazan <ghazan@miranda.im> | 2020-04-25 17:41:18 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-04-25 17:41:18 +0300 |
commit | 147122758513993f4fd8bdc6c341f21d9d8beaca (patch) | |
tree | a746df62ac84acf23b375bda9ab6d5a9fc66199b /plugins/TabSRMM | |
parent | 7378dd16f14d3f9f34cde4a18859d406cd303a22 (diff) |
CLogWindow::LogEvents considered useless and localized inside tabSRMM
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/src/globals.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgother.cpp | 13 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msglog.cpp | 5 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.h | 5 | ||||
-rw-r--r-- | plugins/TabSRMM/src/sendqueue.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/templates.cpp | 2 |
6 files changed, 18 insertions, 13 deletions
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 10b4a25444..e48a705a71 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -536,5 +536,5 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c) dbei.eventType = EVENTTYPE_STATUSCHANGE;
dbei.timestamp = time(0);
dbei.szModule = (char*)c->getProto();
- dat->LogEvent(&dbei);
+ dat->LogEvent(dbei);
}
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp index 249863ec01..8317d4bd0c 100644 --- a/plugins/TabSRMM/src/msgdlgother.cpp +++ b/plugins/TabSRMM/src/msgdlgother.cpp @@ -853,6 +853,19 @@ void CMsgDialog::LoadSplitter() } ///////////////////////////////////////////////////////////////////////////////////////// + +void CMsgDialog::LogEvent(DBEVENTINFO &dbei) +{ + dbei.flags |= DBEF_TEMPORARY; + + MEVENT hDbEvent = db_event_add(m_hContact, &dbei); + if (hDbEvent) { + m_pLog->LogEvents(hDbEvent, 1, true); + db_event_delete(hDbEvent); + } +} + +///////////////////////////////////////////////////////////////////////////////////////// // draw various elements of the message window, like avatar(s), info panel fields // and the color formatting menu diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index cd057cae83..b053d0b47e 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -1207,11 +1207,6 @@ void CLogWindow::LogEvents(MEVENT hDbEventFirst, int count, bool fAppend) LogEvents(hDbEventFirst, count, fAppend, nullptr);
}
-void CLogWindow::LogEvents(DBEVENTINFO *dbei, bool bAppend)
-{
- LogEvents(0, 1, bAppend, dbei);
-}
-
void CLogWindow::LogEvents(MEVENT hDbEventFirst, int count, bool fAppend, DBEVENTINFO *dbei_s)
{
CHARRANGE oldSel, sel;
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index 339e4cbd36..60d429910d 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -311,7 +311,6 @@ public: void Attach() override;
void LogEvents(MEVENT hDbEventFirst, int count, bool bAppend) override;
- void LogEvents(DBEVENTINFO *dbei, bool bAppend) override;
void LogEvents(struct LOGINFO *, bool) override;
void ScrollToBottom() override;
void UpdateOptions() override;
@@ -577,9 +576,7 @@ public: return ((CLogWindow *)m_pLog);
}
- __forceinline void LogEvent(DBEVENTINFO *dbei) {
- m_pLog->LogEvents(dbei, 1);
- }
+ void LogEvent(DBEVENTINFO &dbei);
bool IsActive() const override
{
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index 8f33be1bea..a31bbac0fd 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -358,7 +358,7 @@ void SendQueue::logError(CMsgDialog *dat, int iSendJobIndex, const wchar_t *szEr dbei.cbBlob = (int)iMsgLen; dbei.timestamp = time(0); dbei.szModule = (char *)szErrMsg; - dat->LogEvent(&dbei); + dat->LogEvent(dbei); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -554,7 +554,7 @@ int SendQueue::doSendLater(int iJobIndex, CMsgDialog *dat, MCONTACT hContact, bo dbei.timestamp = time(0); dbei.cbBlob = (int)mir_strlen(utfText) + 1; dbei.pBlob = (PBYTE)(char*)utfText; - dat->LogEvent(&dbei); + dat->LogEvent(dbei); if (dat->m_hDbEventFirst == 0) dat->RemakeLog(); diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index 7829258d75..4b5cc80143 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -262,7 +262,7 @@ void CTemplateEditDlg::onClick_Preview(CCtrlButton*) m_dwFlags = (iIndex == 0 || iIndex == 1) ? m_dwFlags & ~MWF_LOG_GROUPMODE : m_dwFlags | MWF_LOG_GROUPMODE; mir_snwprintf(m_wszMyNickname, L"My Nickname"); m_pLog->Clear(); - LogEvent(&dbei); + LogEvent(dbei); if (changed) memcpy(tSet->szTemplates[inEdit], szTemp, TEMPLATE_LENGTH * sizeof(wchar_t)); } |