diff options
Diffstat (limited to 'src/core/stdmsg')
-rw-r--r-- | src/core/stdmsg/src/cmdlist.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 20 | ||||
-rw-r--r-- | src/core/stdmsg/src/msglog.cpp | 18 |
3 files changed, 20 insertions, 20 deletions
diff --git a/src/core/stdmsg/src/cmdlist.cpp b/src/core/stdmsg/src/cmdlist.cpp index 4d44e69a67..a0226ee979 100644 --- a/src/core/stdmsg/src/cmdlist.cpp +++ b/src/core/stdmsg/src/cmdlist.cpp @@ -93,7 +93,7 @@ void msgQueue_processack(MCONTACT hContact, int id, BOOL success, LPARAM lParam) dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_SENT | DBEF_UTF | (p->flags & DBEF_RTL ? DBEF_RTL : 0);
dbei.szModule = Proto_GetBaseAccountName(hContact);
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
dbei.cbBlob = (uint32_t)(mir_strlen(p->szMsg) + 1);
dbei.pBlob = p->szMsg;
dbei.szId = (char *)lParam;
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index c1d544a028..fdcea57c48 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -141,8 +141,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();
bUpdate = true;
break;
}
@@ -1208,18 +1208,18 @@ void CMsgDialog::EventAdded(MEVENT hDbEvent, const DB::EventInfo &dbei) if (m_hDbEventFirst == 0)
m_hDbEventFirst = hDbEvent;
- bool isMessage = (dbei.eventType == EVENTTYPE_MESSAGE), isSent = ((dbei.flags & DBEF_SENT) != 0);
+ bool isMessage = (dbei.eventType == EVENTTYPE_MESSAGE);
bool isActive = IsActive();
if (DbEventIsShown(dbei)) {
// Sounds *only* for sent messages, not for custom events
- if (isMessage && !isSent) {
+ if (isMessage && !dbei.bSent) {
if (isActive)
Skin_PlaySound("RecvMsgActive");
else
Skin_PlaySound("RecvMsgInactive");
}
- if (isMessage && !isSent) {
- m_lastMessage = dbei.timestamp;
+ if (isMessage && !dbei.bSent) {
+ m_lastMessage = dbei.getUnixtime();
UpdateLastMessage();
}
@@ -1229,7 +1229,7 @@ void CMsgDialog::EventAdded(MEVENT hDbEvent, const DB::EventInfo &dbei) RemakeLog();
// Flash window *only* for messages, not for custom events
- if (isMessage && !isSent)
+ if (isMessage && !dbei.bSent)
if (!isActive || !m_pLog->AtBottom())
StartFlash();
}
@@ -1260,15 +1260,15 @@ bool CMsgDialog::GetFirstEvent() case LOADHISTORY_TIME:
DBEVENTINFO dbei = {};
if (m_hDbEventFirst == 0)
- dbei.timestamp = (uint32_t)time(0);
+ dbei.iTimestamp = (uint32_t)time(0);
else
db_event_get(m_hDbEventFirst, &dbei);
- uint32_t firstTime = dbei.timestamp - 60 * g_plugin.nLoadTime;
+ uint32_t firstTime = dbei.getUnixtime() - 60 * g_plugin.nLoadTime;
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;
}
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 0156f1fa6b..f120d26c27 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -300,7 +300,7 @@ public: }
if (g_plugin.bShowIcons) {
- int i = ((dbei.eventType == EVENTTYPE_MESSAGE) ? ((dbei.flags & DBEF_SENT) ? LOGICON_MSG_OUT : LOGICON_MSG_IN) : LOGICON_MSG_NOTICE);
+ int i = ((dbei.eventType == EVENTTYPE_MESSAGE) ? (dbei.bSent ? LOGICON_MSG_OUT : LOGICON_MSG_IN) : LOGICON_MSG_NOTICE);
buf.Append("\\f0\\fs14");
buf.Append(pLogIconBmpBits[i]);
@@ -321,9 +321,9 @@ public: else
szFormat = g_plugin.bShowDate ? L"d t" : L"t";
- TimeZone_PrintTimeStamp(nullptr, dbei.timestamp, szFormat, str, _countof(str), 0);
+ TimeZone_PrintTimeStamp(nullptr, dbei.getUnixtime(), szFormat, str, _countof(str), 0);
- SetToStyle((dbei.flags & DBEF_SENT) ? MSGFONTID_MYTIME : MSGFONTID_YOURTIME, buf);
+ SetToStyle(dbei.bSent ? MSGFONTID_MYTIME : MSGFONTID_YOURTIME, buf);
AppendToBufferWithRTF(buf, str);
showColon = 1;
}
@@ -331,7 +331,7 @@ public: if (g_plugin.bShowNames && dbei.eventType != EVENTTYPE_JABBER_CHATSTATES && dbei.eventType != EVENTTYPE_JABBER_PRESENCE) {
wchar_t *szName;
- if (dbei.flags & DBEF_SENT) {
+ if (dbei.bSent) {
if (wchar_t *p = Contact::GetInfo(CNF_DISPLAY, 0, dbei.szModule))
szName = NEWWSTR_ALLOCA(p);
else
@@ -339,19 +339,19 @@ public: }
else szName = Clist_GetContactDisplayName(dat->hContact);
- SetToStyle((dbei.flags & DBEF_SENT) ? MSGFONTID_MYNAME : MSGFONTID_YOURNAME, buf);
+ SetToStyle(dbei.bSent ? MSGFONTID_MYNAME : MSGFONTID_YOURNAME, buf);
AppendToBufferWithRTF(buf, szName);
showColon = 1;
}
if (showColon)
- SetToStyle((dbei.flags & DBEF_SENT) ? MSGFONTID_MYCOLON : MSGFONTID_YOURCOLON, buf);
+ SetToStyle(dbei.bSent ? MSGFONTID_MYCOLON : MSGFONTID_YOURCOLON, buf);
wchar_t *msg, *szName;
switch (dbei.eventType) {
case EVENTTYPE_JABBER_CHATSTATES:
case EVENTTYPE_JABBER_PRESENCE:
- if (dbei.flags & DBEF_SENT) {
+ if (dbei.bSent) {
if (wchar_t *p = Contact::GetInfo(CNF_DISPLAY, 0, dbei.szModule)) {
szName = NEWWSTR_ALLOCA(p);
mir_free(p);
@@ -379,7 +379,7 @@ public: InsertFileLink(buf, dat->hDbEvent, blob);
}
else {
- AppendToBufferWithRTF(buf, (dbei.flags & DBEF_SENT) ? TranslateT("File sent") : TranslateT("File received"));
+ AppendToBufferWithRTF(buf, dbei.bSent ? TranslateT("File sent") : TranslateT("File received"));
buf.Append(": ");
AppendToBufferWithRTF(buf, blob.getName());
@@ -395,7 +395,7 @@ public: case EVENTTYPE_MESSAGE:
default:
msg = dbei.getText();
- SetToStyle((dbei.eventType == EVENTTYPE_MESSAGE) ? ((dbei.flags & DBEF_SENT) ? MSGFONTID_MYMSG : MSGFONTID_YOURMSG) : MSGFONTID_NOTICE, buf);
+ SetToStyle((dbei.eventType == EVENTTYPE_MESSAGE) ? (dbei.bSent ? MSGFONTID_MYMSG : MSGFONTID_YOURMSG) : MSGFONTID_NOTICE, buf);
AppendToBufferWithRTF(buf, msg);
mir_free(msg);
}
|