summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r--plugins/TabSRMM/src/globals.cpp2
-rw-r--r--plugins/TabSRMM/src/msgdlgother.cpp13
-rw-r--r--plugins/TabSRMM/src/msglog.cpp5
-rw-r--r--plugins/TabSRMM/src/msgs.h5
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp4
-rw-r--r--plugins/TabSRMM/src/templates.cpp2
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));
}