summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r--plugins/TabSRMM/src/globals.cpp2
-rw-r--r--plugins/TabSRMM/src/hotkeyhandler.cpp2
-rw-r--r--plugins/TabSRMM/src/mim.cpp2
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp4
-rw-r--r--plugins/TabSRMM/src/msgdlgother.cpp24
-rw-r--r--plugins/TabSRMM/src/msglog.cpp28
-rw-r--r--plugins/TabSRMM/src/msgoptions.cpp2
-rw-r--r--plugins/TabSRMM/src/sendlater.cpp2
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp6
9 files changed, 36 insertions, 36 deletions
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index 16bee8adfd..f46d7b6fdd 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -509,7 +509,7 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c)
dbei.cbBlob = (int)mir_strlen(szUtf);
dbei.flags = DBEF_UTF | DBEF_READ;
dbei.eventType = EVENTTYPE_STATUSCHANGE;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
dbei.szModule = (char *)c->getProto();
dat->LogEvent(dbei);
}
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp
index 85918bcd04..553e000912 100644
--- a/plugins/TabSRMM/src/hotkeyhandler.cpp
+++ b/plugins/TabSRMM/src/hotkeyhandler.cpp
@@ -224,7 +224,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (!AutoCreateWindow(0, wParam) && lParam) {
// no window created, simply add an unread event to contact list
DB::EventInfo dbei(lParam, false);
- if (dbei && !(dbei.flags & DBEF_READ)) {
+ if (dbei && !dbei.bRead) {
AddUnreadContact(wParam);
Srmm_AddEvent(wParam, lParam);
}
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index 38c39e84af..fb54eab03f 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -446,7 +446,7 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent)
nowindowcreate:
// for tray support, we add the event to the tray menu. otherwise we send it back to
// the contact list for flashing
- if (!(dbei.flags & DBEF_READ)) {
+ if (!dbei.bRead) {
AddUnreadContact(hContact);
Srmm_AddEvent(hContact, hDbEvent);
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 56ee17a4bc..af9b6cfd5b 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -576,8 +576,8 @@ bool CMsgDialog::OnInitDialog()
while (MEVENT hdbEvent = pCursor.FetchNext()) {
DBEVENTINFO dbei = {};
db_event_get(hdbEvent, &dbei);
- if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) {
- m_lastMessage = dbei.timestamp;
+ if (dbei.eventType == EVENTTYPE_MESSAGE && !dbei.bSent) {
+ m_lastMessage = dbei.getUnixtime();
DM_UpdateLastMessage();
break;
}
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp
index 2652a42e00..1bf3dde416 100644
--- a/plugins/TabSRMM/src/msgdlgother.cpp
+++ b/plugins/TabSRMM/src/msgdlgother.cpp
@@ -298,13 +298,13 @@ void CMsgDialog::EventAdded(MEVENT hDbEvent, const DB::EventInfo &dbei)
bool bAlertable = dbei.isAlertable();
bool bIsStatusChangeEvent = IsStatusEvent(dbei.eventType);
- bool bDisableNotify = (bAlertable && (dbei.flags & DBEF_READ));
+ bool bDisableNotify = (bAlertable && dbei.bRead);
if (!DbEventIsShown(dbei))
return;
- if (bAlertable && !(dbei.flags & DBEF_SENT)) {
- m_lastMessage = dbei.timestamp;
+ if (bAlertable && !dbei.bSent) {
+ m_lastMessage = dbei.getUnixtime();
m_wszStatusBar[0] = 0;
if (m_bShowTyping) {
m_nTypeSecs = 0;
@@ -318,7 +318,7 @@ void CMsgDialog::EventAdded(MEVENT hDbEvent, const DB::EventInfo &dbei)
// set the message log divider to mark new (maybe unseen) messages, if the container has
// been minimized or in the background.
- if (!(dbei.flags & DBEF_SENT) && !bIsStatusChangeEvent) {
+ if (!dbei.bSent && !bIsStatusChangeEvent) {
if (g_plugin.bDividersUsePopupConfig && g_plugin.bUseDividers) {
if (!MessageWindowOpened(m_hContact, nullptr))
DM_AddDivider();
@@ -342,7 +342,7 @@ void CMsgDialog::EventAdded(MEVENT hDbEvent, const DB::EventInfo &dbei)
// handle tab flashing
if (!bDisableNotify && !bIsStatusChangeEvent)
- if ((TabCtrl_GetCurSel(m_hwndParent) != m_iTabID) && !(dbei.flags & DBEF_SENT)) {
+ if ((TabCtrl_GetCurSel(m_hwndParent) != m_iTabID) && !dbei.bSent) {
switch (dbei.eventType) {
case EVENTTYPE_MESSAGE:
m_iFlashIcon = PluginConfig.g_IconMsgEvent;
@@ -364,7 +364,7 @@ void CMsgDialog::EventAdded(MEVENT hDbEvent, const DB::EventInfo &dbei)
// autoswitch tab if option is set AND container is minimized (otherwise, we never autoswitch)
// never switch for status changes...
- if (!(dbei.flags & DBEF_SENT) && !bIsStatusChangeEvent) {
+ if (!dbei.bSent && !bIsStatusChangeEvent) {
if (g_plugin.bAutoSwitchTabs && m_pContainer->m_hwndActive != m_hwnd) {
if ((IsIconic(m_pContainer->m_hwnd) && !IsZoomed(m_pContainer->m_hwnd)) || (g_plugin.bHideOnClose && !IsWindowVisible(m_pContainer->m_hwnd))) {
int iItem = GetTabIndexFromHWND(GetParent(m_hwnd), m_hwnd);
@@ -381,7 +381,7 @@ void CMsgDialog::EventAdded(MEVENT hDbEvent, const DB::EventInfo &dbei)
// flash window if it is not focused
if (!bDisableNotify && !bIsStatusChangeEvent)
- if (!IsActive() && !(dbei.flags & DBEF_SENT)) {
+ if (!IsActive() && !dbei.bSent) {
if (!m_pContainer->cfg.flags.m_bNoFlash && !m_pContainer->IsActive())
m_pContainer->FlashContainer(1, 0);
m_pContainer->SetIcon(this, Skin_LoadIcon(SKINICON_EVENT_MESSAGE));
@@ -389,7 +389,7 @@ void CMsgDialog::EventAdded(MEVENT hDbEvent, const DB::EventInfo &dbei)
}
// play a sound
- if (!bDisableNotify && bAlertable && !(dbei.flags & DBEF_SENT))
+ if (!bDisableNotify && bAlertable && !dbei.bSent)
PlayIncomingSound();
if (m_pWnd)
@@ -435,16 +435,16 @@ bool CMsgDialog::GetFirstEvent()
case LOADHISTORY_TIME:
if (m_hDbEventFirst == 0)
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
else
db_event_get(m_hDbEventFirst, &dbei);
- uint32_t firstTime = dbei.timestamp - 60 * g_plugin.getWord(SRMSGSET_LOADTIME, SRMSGDEFSET_LOADTIME);
+ uint32_t firstTime = dbei.getUnixtime() - 60 * g_plugin.getWord(SRMSGSET_LOADTIME, SRMSGDEFSET_LOADTIME);
while (MEVENT hPrevEvent = pCursor.FetchNext()) {
dbei.cbBlob = 0;
db_event_get(hPrevEvent, &dbei);
- if (dbei.timestamp < firstTime)
+ if (dbei.getUnixtime() < firstTime)
break;
m_hDbEventFirst = hPrevEvent;
}
@@ -493,7 +493,7 @@ int CMsgDialog::FindRTLLocale()
void CMsgDialog::FlashOnClist(MEVENT hEvent, const DB::EventInfo &dbei)
{
m_dwTickLastEvent = GetTickCount();
- bool bSent = dbei.flags & DBEF_SENT;
+ bool bSent = dbei.bSent;
if ((GetForegroundWindow() != m_pContainer->m_hwnd || m_pContainer->m_hwndActive != m_hwnd) && !bSent) {
m_dwUnread++;
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index d4cb88232e..1c0085df3f 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -568,8 +568,8 @@ bool CLogWindow::CreateRtfEvent(RtfLogStreamData *streamData, DB::EventInfo &dbe
if (dbei.eventType == EVENTTYPE_MESSAGE && !dbei.markedRead())
dat->m_cache->updateStats(TSessionStats::SET_LAST_RCV, mir_strlen((char *)dbei.pBlob));
- BOOL isSent = (dbei.flags & DBEF_SENT);
- BOOL bIsStatusChangeEvent = IsStatusEvent(dbei.eventType);
+ bool isSent = dbei.bSent;
+ bool bIsStatusChangeEvent = IsStatusEvent(dbei.eventType);
if (!isSent && bIsStatusChangeEvent)
dbei.wipeNotify();
@@ -596,7 +596,7 @@ bool CLogWindow::CreateRtfEvent(RtfLogStreamData *streamData, DB::EventInfo &dbe
uint32_t dwEffectiveFlags = dat->m_dwFlags;
- dat->m_bIsHistory = (dbei.timestamp < dat->m_cache->getSessionStart() && dbei.markedRead());
+ dat->m_bIsHistory = (dbei.getUnixtime() < dat->m_cache->getSessionStart() && dbei.markedRead());
int iFontIDOffset = dat->m_bIsHistory ? 8 : 0; // offset into the font table for either history (old) or new events... (# of fonts per configuration set)
g_groupBreak = TRUE;
@@ -610,9 +610,9 @@ bool CLogWindow::CreateRtfEvent(RtfLogStreamData *streamData, DB::EventInfo &dbe
dat->m_bDividerWanted = false;
}
- if (dwEffectiveFlags & MWF_LOG_GROUPMODE && ((dbei.flags & (DBEF_SENT | DBEF_READ | DBEF_RTL)) == LOWORD(dat->m_iLastEventType)) && dbei.eventType == EVENTTYPE_MESSAGE && HIWORD(dat->m_iLastEventType) == EVENTTYPE_MESSAGE && (dbei.timestamp - dat->m_lastEventTime) < 86400) {
+ if (dwEffectiveFlags & MWF_LOG_GROUPMODE && ((dbei.flags & (DBEF_SENT | DBEF_READ | DBEF_RTL)) == LOWORD(dat->m_iLastEventType)) && dbei.eventType == EVENTTYPE_MESSAGE && HIWORD(dat->m_iLastEventType) == EVENTTYPE_MESSAGE && (dbei.getUnixtime() - dat->m_lastEventTime) < 86400) {
g_groupBreak = FALSE;
- if ((time_t)dbei.timestamp > today && dat->m_lastEventTime < today)
+ if ((time_t)dbei.getUnixtime() > today && dat->m_lastEventTime < today)
g_groupBreak = TRUE;
}
@@ -642,7 +642,7 @@ bool CLogWindow::CreateRtfEvent(RtfLogStreamData *streamData, DB::EventInfo &dbe
// templated code starts here
if (dwEffectiveFlags & MWF_LOG_SHOWTIME) {
hTimeZone = ((dat->m_dwFlags & MWF_LOG_LOCALTIME) && !isSent) ? dat->m_hTimeZone : nullptr;
- time_t local_time = TimeZone_UtcToLocal(hTimeZone, dbei.timestamp);
+ time_t local_time = TimeZone_UtcToLocal(hTimeZone, dbei.getUnixtime());
event_time = *gmtime(&local_time);
}
@@ -765,14 +765,14 @@ bool CLogWindow::CreateRtfEvent(RtfLogStreamData *streamData, DB::EventInfo &dbe
break;
case 'D': // long date
if (showTime && showDate) {
- wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, 'D');
+ wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.getUnixtime(), 'D');
AppendTimeStamp(szFinalTimestamp, isSent, str, skipFont, dat, iFontIDOffset);
}
else skipToNext = true;
break;
case 'E': // short date...
if (showTime && showDate) {
- wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, 'E');
+ wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.getUnixtime(), 'E');
AppendTimeStamp(szFinalTimestamp, isSent, str, skipFont, dat, iFontIDOffset);
}
else skipToNext = true;
@@ -871,7 +871,7 @@ bool CLogWindow::CreateRtfEvent(RtfLogStreamData *streamData, DB::EventInfo &dbe
case 'R':
case 'r': // long date
if (showTime && showDate) {
- wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, cc);
+ wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.getUnixtime(), cc);
AppendTimeStamp(szFinalTimestamp, isSent, str, skipFont, dat, iFontIDOffset);
}
else skipToNext = true;
@@ -879,7 +879,7 @@ bool CLogWindow::CreateRtfEvent(RtfLogStreamData *streamData, DB::EventInfo &dbe
case 't':
case 'T':
if (showTime) {
- wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.timestamp, (wchar_t)((dwEffectiveFlags & MWF_LOG_SHOWSECONDS) ? cc : (wchar_t)'t'));
+ wchar_t *szFinalTimestamp = Template_MakeRelativeDate(hTimeZone, dbei.getUnixtime(), (wchar_t)((dwEffectiveFlags & MWF_LOG_SHOWSECONDS) ? cc : (wchar_t)'t'));
AppendTimeStamp(szFinalTimestamp, isSent, str, skipFont, dat, iFontIDOffset);
}
else skipToNext = true;
@@ -1116,7 +1116,7 @@ skip:
str.Append("\\par");
dat->m_iLastEventType = MAKELONG((dbei.flags & (DBEF_SENT | DBEF_READ | DBEF_RTL)), dbei.eventType);
- dat->m_lastEventTime = dbei.timestamp;
+ dat->m_lastEventTime = dbei.getUnixtime();
return true;
}
@@ -1205,12 +1205,12 @@ void CLogWindow::LogEvents(MEVENT hDbEventFirst, int count, bool fAppend, DB::Ev
m_pDlg.m_bLastParaDeleted = true;
}
- BOOL isSent;
+ bool isSent;
if (streamData.dbei != nullptr)
- isSent = (streamData.dbei->flags & DBEF_SENT) != 0;
+ isSent = streamData.dbei->bSent;
else {
DB::EventInfo dbei(hDbEventFirst, false);
- isSent = (dbei.flags & DBEF_SENT) != 0;
+ isSent = dbei.bSent;
}
ReplaceIcons(startAt, fAppend, isSent);
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp
index 2c4f020055..382af9cd11 100644
--- a/plugins/TabSRMM/src/msgoptions.cpp
+++ b/plugins/TabSRMM/src/msgoptions.cpp
@@ -625,7 +625,7 @@ public:
DB::EventInfo dbei;
dbei.szModule = m_szProto;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
dbei.eventType = (iIndex == 6) ? EVENTTYPE_STATUSCHANGE : EVENTTYPE_MESSAGE;
dbei.eventType = (iIndex == 7) ? EVENTTYPE_ERRMSG : dbei.eventType;
if (dbei.eventType == EVENTTYPE_ERRMSG)
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp
index d1d3ec9186..d48b975f39 100644
--- a/plugins/TabSRMM/src/sendlater.cpp
+++ b/plugins/TabSRMM/src/sendlater.cpp
@@ -792,7 +792,7 @@ HANDLE SendLater::processAck(const ACKDATA *ack)
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.szModule = Proto_GetBaseAccountName((p->hContact));
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
dbei.cbBlob = (int)mir_strlen(p->sendBuffer) + 1;
dbei.pBlob = p->sendBuffer;
db_event_add(p->hContact, &dbei);
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp
index e2206515d6..6698e6c563 100644
--- a/plugins/TabSRMM/src/sendqueue.cpp
+++ b/plugins/TabSRMM/src/sendqueue.cpp
@@ -357,7 +357,7 @@ void SendQueue::logError(CMsgDialog *dat, int iSendJobIndex, const wchar_t *szEr
dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.cbBlob = (int)iMsgLen;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
dbei.szModule = (char *)szErrMsg;
dat->LogEvent(dbei);
@@ -461,7 +461,7 @@ int SendQueue::ackMessage(CMsgDialog *dat, WPARAM wParam, LPARAM lParam)
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.szModule = Proto_GetBaseAccountName(job.hContact);
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
dbei.cbBlob = (int)mir_strlen(job.szSendBuffer) + 1;
if (dat)
@@ -548,7 +548,7 @@ int SendQueue::doSendLater(int iJobIndex, CMsgDialog *dat, MCONTACT hContact, bo
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.szModule = Proto_GetBaseAccountName(dat->m_hContact);
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
dbei.pBlob = szUtf;
dbei.cbBlob = (int)mir_strlen(szUtf);
dat->LogEvent(dbei);