summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/CloudFile/src/utils.cpp2
-rw-r--r--protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp2
-rw-r--r--protocols/Discord/src/dispatch.cpp2
-rw-r--r--protocols/Discord/src/server.cpp2
-rw-r--r--protocols/Discord/src/utils.cpp4
-rw-r--r--protocols/EmLanProto/src/mlan.cpp6
-rw-r--r--protocols/Facebook/src/server.cpp6
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp6
-rw-r--r--protocols/Gadu-Gadu/src/filetransfer.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/image.cpp2
-rw-r--r--protocols/GmailNotifier/src/notify.cpp2
-rw-r--r--protocols/ICQCorp/src/protocol.cpp6
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp6
-rw-r--r--protocols/IRCG/src/irclib.cpp2
-rw-r--r--protocols/JabberG/src/jabber_archive.cpp8
-rw-r--r--protocols/JabberG/src/jabber_file.cpp2
-rw-r--r--protocols/JabberG/src/jabber_ft.cpp4
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp2
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp6
-rw-r--r--protocols/JabberG/src/jabber_omemo.cpp2
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp4
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp6
-rw-r--r--protocols/NewsAggregator/Src/CheckFeed.cpp4
-rw-r--r--protocols/Sametime/src/files.cpp2
-rw-r--r--protocols/Sametime/src/messaging.cpp2
-rw-r--r--protocols/SkypeWeb/src/skype_contacts.cpp2
-rw-r--r--protocols/SkypeWeb/src/skype_history_sync.cpp2
-rw-r--r--protocols/SkypeWeb/src/skype_messages.cpp4
-rw-r--r--protocols/Steam/src/steam_chats.cpp4
-rw-r--r--protocols/Steam/src/steam_contacts.cpp2
-rw-r--r--protocols/Steam/src/steam_history.cpp8
-rw-r--r--protocols/Steam/src/steam_messages.cpp2
-rw-r--r--protocols/Steam/src/steam_proto.cpp2
-rw-r--r--protocols/Telegram/src/proto.cpp2
-rw-r--r--protocols/Telegram/src/server.cpp4
-rw-r--r--protocols/Telegram/src/utils.cpp5
-rw-r--r--protocols/Tox/src/tox_contacts.cpp2
-rw-r--r--protocols/Tox/src/tox_messages.cpp2
-rw-r--r--protocols/Tox/src/tox_transfer.cpp2
-rw-r--r--protocols/Tox/src/tox_utils.cpp2
-rw-r--r--protocols/Twitter/src/connection.cpp4
-rw-r--r--protocols/VKontakte/src/misc.cpp8
-rw-r--r--protocols/VKontakte/src/vk_chats.cpp2
-rw-r--r--protocols/VKontakte/src/vk_feed.cpp4
-rw-r--r--protocols/VKontakte/src/vk_history.cpp4
-rw-r--r--protocols/VKontakte/src/vk_messages.cpp8
-rw-r--r--protocols/VKontakte/src/vk_pollserver.cpp2
-rw-r--r--protocols/Weather/src/weather_update.cpp2
-rw-r--r--protocols/WhatsApp/src/appsync.cpp2
-rw-r--r--protocols/WhatsApp/src/message.cpp2
50 files changed, 87 insertions, 88 deletions
diff --git a/protocols/CloudFile/src/utils.cpp b/protocols/CloudFile/src/utils.cpp
index 755746f197..90832cb861 100644
--- a/protocols/CloudFile/src/utils.cpp
+++ b/protocols/CloudFile/src/utils.cpp
@@ -27,7 +27,7 @@ MEVENT AddEventToDb(MCONTACT hContact, uint16_t type, uint32_t flags, uint32_t c
{
DBEVENTINFO dbei = {};
dbei.szModule = MODULENAME;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
dbei.eventType = type;
dbei.cbBlob = cbBlob;
dbei.pBlob = pBlob;
diff --git a/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp b/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp
index 3b11bf4700..c4cfc69800 100644
--- a/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp
+++ b/protocols/CurrencyRates/src/CurrencyRatesProviderBase.cpp
@@ -375,7 +375,7 @@ void log_to_history(const ICurrencyRatesProvider *pProvider, MCONTACT hContact,
DBEVENTINFO dbei = {};
dbei.szModule = MODULENAME;
- dbei.timestamp = static_cast<uint32_t>(nTime);
+ dbei.iTimestamp = static_cast<uint32_t>(nTime);
dbei.flags = DBEF_READ | DBEF_UTF;
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.cbBlob = (int)::mir_strlen(psz) + 1;
diff --git a/protocols/Discord/src/dispatch.cpp b/protocols/Discord/src/dispatch.cpp
index 1d4209715f..564e58f623 100644
--- a/protocols/Discord/src/dispatch.cpp
+++ b/protocols/Discord/src/dispatch.cpp
@@ -529,7 +529,7 @@ void CDiscordProto::OnCommandMessage(const JSONNode &pRoot, bool bIsNew)
debugLogA("store a message from private user %lld, channel id %lld", pUser->id, pUser->channelId);
- dbei.timestamp = (uint32_t)StringToDate(pRoot["timestamp"].as_mstring());
+ dbei.iTimestamp = (uint32_t)StringToDate(pRoot["timestamp"].as_mstring());
dbei.szId = szMsgId;
replaceStr(dbei.pBlob, mir_utf8encodeW(wszText));
dbei.cbBlob = (int)mir_strlen(dbei.pBlob);
diff --git a/protocols/Discord/src/server.cpp b/protocols/Discord/src/server.cpp
index beef589e30..dae31e4c16 100644
--- a/protocols/Discord/src/server.cpp
+++ b/protocols/Discord/src/server.cpp
@@ -103,7 +103,7 @@ void CDiscordProto::OnReceiveHistory(MHttpResponse *pReply, AsyncHttpRequest *pR
dbei.szModule = m_szModuleName;
dbei.flags = DBEF_UTF;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.timestamp = dwTimeStamp;
+ dbei.iTimestamp = dwTimeStamp;
if (authorid == m_ownId)
dbei.flags |= DBEF_SENT;
diff --git a/protocols/Discord/src/utils.cpp b/protocols/Discord/src/utils.cpp
index ce5a88ae58..af272db097 100644
--- a/protocols/Discord/src/utils.cpp
+++ b/protocols/Discord/src/utils.cpp
@@ -380,7 +380,7 @@ CMStringW CDiscordProto::PrepareMessageText(const JSONNode &pRoot, CDiscordUser
DB::EventInfo dbei(db_event_getById(m_szModuleName, szId));
dbei.flags = DBEF_TEMPORARY;
- dbei.timestamp = (uint32_t)StringToDate(pRoot["timestamp"].as_mstring());
+ dbei.iTimestamp = (uint32_t)StringToDate(pRoot["timestamp"].as_mstring());
dbei.szId = szId;
dbei.szUserId = szUserId;
if (_atoi64(szUserId) == m_ownId)
@@ -479,7 +479,7 @@ void CDiscordProto::ProcessType(CDiscordUser *pUser, const JSONNode &pRoot)
DB::AUTH_BLOB blob(pUser->hContact, T2Utf(pUser->wszUsername), nullptr, nullptr, szId, nullptr);
DB::EventInfo dbei;
- dbei.timestamp = (uint32_t)time(0);
+ dbei.iTimestamp = (uint32_t)time(0);
dbei.cbBlob = blob.size();
dbei.pBlob = blob;
ProtoChainRecv(pUser->hContact, PSR_AUTH, 0, (LPARAM)&dbei);
diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp
index 662df2d566..48b170794c 100644
--- a/protocols/EmLanProto/src/mlan.cpp
+++ b/protocols/EmLanProto/src/mlan.cpp
@@ -267,7 +267,7 @@ void CMLan::OnRecvPacket(u_char *mes, int len, in_addr from)
RequestStatus(true, from.S_un.S_addr);
else {
DB::EventInfo dbei;
- dbei.timestamp = get_time();
+ dbei.iTimestamp = get_time();
dbei.pBlob = pak.strMessage;
ProtoChainRecvMsg(FindContact(cont->m_addr, cont->m_nick, true, false, false, cont->m_status), dbei);
@@ -286,7 +286,7 @@ void CMLan::OnRecvPacket(u_char *mes, int len, in_addr from)
if (pak.strAwayMessage && cont) {
DB::EventInfo dbei;
- dbei.timestamp = get_time();
+ dbei.iTimestamp = get_time();
dbei.pBlob = pak.strAwayMessage;
dbei.cbBlob = pak.idAckAwayMessage;
ProtoChainRecv(FindContact(cont->m_addr, cont->m_nick, true, false, false, cont->m_status), PSR_AWAYMSG, 0, (LPARAM)&dbei);
@@ -966,7 +966,7 @@ void CMLan::OnInTCPConnection(u_long addr, SOCKET in_sock)
*pf_to++ = *pf_fr++;
conn->m_hContact = FindContact(cont->m_addr, cont->m_nick, true, false, false, cont->m_status);
- dbei.timestamp = get_time();
+ dbei.iTimestamp = get_time();
ProtoChainRecv(conn->m_hContact, PSR_FILE, 0, (LPARAM)&dbei);
while (!conn->m_state)
diff --git a/protocols/Facebook/src/server.cpp b/protocols/Facebook/src/server.cpp
index 166256c9e1..f660fee8bd 100644
--- a/protocols/Facebook/src/server.cpp
+++ b/protocols/Facebook/src/server.cpp
@@ -845,7 +845,7 @@ void FacebookProto::OnPublishPrivateMessage(const JSONNode &root)
auto szActorFbId(metadata["actorFbId"].as_string());
DB::EventInfo dbei;
- dbei.timestamp = uint32_t(_wtoi64(metadata["timestamp"].as_mstring()) / 1000);
+ dbei.iTimestamp = uint32_t(_wtoi64(metadata["timestamp"].as_mstring()) / 1000);
dbei.pBlob = (char *)szBody.c_str();
dbei.szId = (char *)szId.c_str();
if (m_uid == _atoi64(szActorFbId.c_str()))
@@ -952,10 +952,10 @@ void FacebookProto::OnPublishReadReceipt(const JSONNode &root)
if (!dbei)
continue;
- if (dbei.timestamp > timestamp)
+ if (dbei.getUnixtime() > timestamp)
break;
- if (dbei.flags & DBEF_SENT)
+ if (dbei.bSent)
dbei.wipeNotify();
}
}
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp
index 6a84c1b251..dbb76cd5fa 100644
--- a/protocols/Gadu-Gadu/src/core.cpp
+++ b/protocols/Gadu-Gadu/src/core.cpp
@@ -824,7 +824,7 @@ retry:
else if (!e->event.msg.recipients_count && e->event.msg.message && *e->event.msg.message && mir_strcmp(e->event.msg.message, "\xA0\0")) {
DB::EventInfo dbei;
time_t t = time(0);
- dbei.timestamp = (!(e->event.msg.msgclass & GG_CLASS_OFFLINE) || e->event.msg.time > (t - timeDeviation)) ? t : e->event.msg.time;
+ dbei.iTimestamp = (!(e->event.msg.msgclass & GG_CLASS_OFFLINE) || e->event.msg.time > (t - timeDeviation)) ? t : e->event.msg.time;
dbei.pBlob = e->event.msg.message;
ProtoChainRecvMsg(getcontact(e->event.msg.sender, 1, 0, nullptr), dbei);
}
@@ -893,7 +893,7 @@ retry:
{
DBEVENTINFO dbei = {};
dbei.szModule = m_szModuleName;
- dbei.timestamp = (uint32_t)e->event.multilogon_msg.time;
+ dbei.iTimestamp = (uint32_t)e->event.multilogon_msg.time;
dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.cbBlob = (uint32_t)mir_strlen(e->event.multilogon_msg.message) + 1;
@@ -1027,7 +1027,7 @@ retry:
const char *fileName = (const char*)dcc7->filename;
DB::EventInfo dbei;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
ProtoChainRecvFile((UINT_PTR)dcc7->contact, DB::FILE_BLOB(dcc7, fileName, fileName), dbei);
e->event.dcc7_new = nullptr;
diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp
index 9377736402..cc6bb1121c 100644
--- a/protocols/Gadu-Gadu/src/filetransfer.cpp
+++ b/protocols/Gadu-Gadu/src/filetransfer.cpp
@@ -368,7 +368,7 @@ void __cdecl GaduProto::dccmainthread(void*)
const char *pszFileName = (const char *)m_dcc->file_info.filename;
DB::EventInfo dbei;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 7, "ft_mutex", 1);
ProtoChainRecvFile((UINT_PTR)local_dcc->contact, DB::FILE_BLOB(local_dcc, pszFileName, pszFileName), dbei);
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp
index 79ffd36e22..89027f1e1e 100644
--- a/protocols/Gadu-Gadu/src/image.cpp
+++ b/protocols/Gadu-Gadu/src/image.cpp
@@ -867,7 +867,7 @@ int GaduProto::img_displayasmsg(MCONTACT hContact, void *img)
T2Utf szMessage(image_msg);
DB::EventInfo dbei;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
dbei.pBlob = szMessage;
ProtoChainRecvMsg(hContact, dbei);
debugLogW(L"img_displayasmsg(): Image saved to %s.", szPath);
diff --git a/protocols/GmailNotifier/src/notify.cpp b/protocols/GmailNotifier/src/notify.cpp
index cd4ed69fb9..536bd7f0eb 100644
--- a/protocols/GmailNotifier/src/notify.cpp
+++ b/protocols/GmailNotifier/src/notify.cpp
@@ -145,7 +145,7 @@ void NotifyUser(Account *curAcc)
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_READ;
dbei.szModule = MODULENAME;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
resultLink *prst = curAcc->results.next;
for (int i = 0; i < newMails; i++) {
diff --git a/protocols/ICQCorp/src/protocol.cpp b/protocols/ICQCorp/src/protocol.cpp
index 576bf6eb76..25fa81c8f2 100644
--- a/protocols/ICQCorp/src/protocol.cpp
+++ b/protocols/ICQCorp/src/protocol.cpp
@@ -1985,7 +1985,7 @@ void ICQ::addMessage(ICQUser *u, char *m, time_t t)
Netlib_Logf(hNetlibUser, "message: %s\n", m);
DB::EventInfo dbei;
- dbei.timestamp = t;
+ dbei.iTimestamp = t;
dbei.pBlob = m;
ProtoChainRecvMsg(u->hContact, dbei);
}
@@ -1997,7 +1997,7 @@ void ICQ::addAwayMsg(ICQUser *u, char *m, unsigned long theSequence, time_t t)
Netlib_Logf(hNetlibUser, "away msg: %s\n", m);
DB::EventInfo dbei;
- dbei.timestamp = t;
+ dbei.iTimestamp = t;
dbei.pBlob = m;
dbei.cbBlob = theSequence;
@@ -2019,7 +2019,7 @@ void ICQ::addFileReq(ICQUser *u, char *m, char *filename, unsigned long size, un
DB::FILE_BLOB blob(transfer, filename, m);
DB::EventInfo dbei;
- dbei.timestamp = t;
+ dbei.iTimestamp = t;
blob.write(dbei);
CCSDATA ccs = { u->hContact, PSR_FILE, 0, (LPARAM)&dbei };
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index 4daf29d855..9ad4727601 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -226,7 +226,7 @@ int CIrcProto::AddOutgoingMessageToDB(MCONTACT hContact, const wchar_t *msg)
DBEVENTINFO dbei = {};
dbei.szModule = m_szModuleName;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.timestamp = (uint32_t)time(0);
+ dbei.iTimestamp = (uint32_t)time(0);
dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.pBlob = mir_utf8encodeW(S);
dbei.cbBlob = (uint32_t)mir_strlen((char*)dbei.pBlob) + 1;
@@ -700,7 +700,7 @@ bool CIrcProto::OnIrc_PRIVMSG(const CIrcMessage *pmsg)
T2Utf utf(mess);
DB::EventInfo dbei;
- dbei.timestamp = (uint32_t)time(0);
+ dbei.iTimestamp = (uint32_t)time(0);
dbei.pBlob = utf;
setWString(hContact, "User", pmsg->prefix.sUser);
setWString(hContact, "Host", pmsg->prefix.sHost);
@@ -1147,7 +1147,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage *pmsg)
setWString(hContact, "Host", pmsg->prefix.sHost);
DB::EventInfo dbei;
- dbei.timestamp = (uint32_t)time(0);
+ dbei.iTimestamp = (uint32_t)time(0);
ProtoChainRecvFile(hContact, DB::FILE_BLOB(di, T2Utf(sFile)), dbei);
}
}
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp
index 2861324bb0..281812c903 100644
--- a/protocols/IRCG/src/irclib.cpp
+++ b/protocols/IRCG/src/irclib.cpp
@@ -1275,7 +1275,7 @@ void CDccSession::DoChatReceive()
if (*pStart) {
// send it off to some messaging module
DB::EventInfo dbei;
- dbei.timestamp = (uint32_t)time(0);
+ dbei.iTimestamp = (uint32_t)time(0);
dbei.pBlob = pStart;
ProtoChainRecvMsg(di->hContact, dbei);
}
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp
index 994f48a840..dde2369d4e 100644
--- a/protocols/JabberG/src/jabber_archive.cpp
+++ b/protocols/JabberG/src/jabber_archive.cpp
@@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
bool operator==(const DBEVENTINFO &ev1, const DBEVENTINFO &ev2)
{
- return ev1.timestamp == ev2.timestamp && ev1.eventType == ev2.eventType && ev1.cbBlob == ev2.cbBlob && (ev1.flags & DBEF_SENT) == (ev2.flags & DBEF_SENT);
+ return ev1.iTimestamp == ev2.iTimestamp && ev1.eventType == ev2.eventType && ev1.cbBlob == ev2.cbBlob && ev1.bSent == ev2.bSent;
}
void CJabberProto::EnableArchive(bool bEnable)
@@ -117,9 +117,9 @@ void CJabberProto::OnIqResultGetCollection(const TiXmlElement *iqNode, CJabberIq
msg.process();
- tmStart = msg.dbei.timestamp;
- if (msg.dbei.timestamp > tmLast)
- tmLast = msg.dbei.timestamp;
+ tmStart = msg.dbei.getUnixtime();
+ if (msg.dbei.getUnixtime() > tmLast)
+ tmLast = msg.dbei.getUnixtime();
}
if (tmLast != 0)
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp
index bd04905ccd..c43f1509d7 100644
--- a/protocols/JabberG/src/jabber_file.cpp
+++ b/protocols/JabberG/src/jabber_file.cpp
@@ -177,7 +177,7 @@ void CJabberProto::FileProcessHttpDownload(MCONTACT hContact, const char *jid, c
DB::EventInfo dbei;
dbei.flags = DBEF_TEMPORARY;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
ProtoChainRecvFile(ft->std.hContact, DB::FILE_BLOB(ft, szName, pszDescr), dbei);
}
diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp
index da6cd6425f..97299e6b5d 100644
--- a/protocols/JabberG/src/jabber_ft.cpp
+++ b/protocols/JabberG/src/jabber_ft.cpp
@@ -467,7 +467,7 @@ void CJabberProto::FtHandleSiRequest(const TiXmlElement *iqNode)
ft->std.totalBytes = ft->std.currentFileSize = filesize;
DB::EventInfo dbei;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
ProtoChainRecvFile(ft->std.hContact, DB::FILE_BLOB(ft, filename, XmlGetChildText(fileNode, "desc")), dbei);
return;
}
@@ -874,7 +874,7 @@ bool CJabberProto::FtTryInlineFile(filetransfer *ft)
DB::EventInfo dbei;
dbei.flags = DBEF_READ | DBEF_SENT;
dbei.pBlob = szMsg.GetBuffer();
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
ProtoChainRecvMsg(ft->std.hContact, dbei);
return true;
}
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index d99cabebd4..ede6e546a1 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -324,7 +324,7 @@ bool CJabberProto::OnIqRequestOOB(const TiXmlElement*, CJabberIqInfo *pInfo)
str2 = ft->httpPath;
DB::EventInfo dbei;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
ProtoChainRecvFile(ft->std.hContact, DB::FILE_BLOB(ft, str2, desc), dbei);
}
else { // reject
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index d841716ab2..b50829a943 100644
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -53,7 +53,7 @@ void CJabberProto::DBAddAuthRequest(const char *jid, const char *nick)
DB::AUTH_BLOB blob(hContact, nick, nullptr, nullptr, jid, nullptr);
DB::EventInfo dbei;
- dbei.timestamp = (uint32_t)time(0);
+ dbei.iTimestamp = (uint32_t)time(0);
dbei.cbBlob = blob.size();
dbei.pBlob = blob;
ProtoChainRecv(hContact, PSR_AUTH, 0, (LPARAM)&dbei);
@@ -126,7 +126,7 @@ bool CJabberProto::AddDbPresenceEvent(MCONTACT hContact, uint8_t btEventType)
dbei.cbBlob = sizeof(btEventType);
dbei.eventType = EVENTTYPE_JABBER_PRESENCE;
dbei.flags = DBEF_READ;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
dbei.szModule = m_szModuleName;
db_event_add(hContact, &dbei);
return true;
@@ -500,7 +500,7 @@ void CJabberProto::OnGetBob(const TiXmlElement *node, CJabberIqInfo *pReq)
wszFileName.Insert(0, L"[img]"); wszFileName.Append(L"[/img]");
T2Utf szMsg(wszFileName);
DB::EventInfo dbei;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
dbei.pBlob = szMsg;
ProtoChainRecvMsg(pReq->GetHContact(), dbei);
}
diff --git a/protocols/JabberG/src/jabber_omemo.cpp b/protocols/JabberG/src/jabber_omemo.cpp
index c9956dda17..e87414d68f 100644
--- a/protocols/JabberG/src/jabber_omemo.cpp
+++ b/protocols/JabberG/src/jabber_omemo.cpp
@@ -1405,7 +1405,7 @@ bool CJabberProto::OmemoHandleMessage(XmppMsg *msg, const TiXmlElement *node, co
DBEVENTINFO dbei = {};
dbei.szModule = Proto_GetBaseAccountName(hContact);
- dbei.timestamp = msgTime;
+ dbei.iTimestamp = msgTime;
dbei.eventType = EVENTTYPE_FILE;
if (trusted)
dbei.flags = DBEF_SECURE;
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index 7e9800b1c2..e273d169fe 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -450,7 +450,7 @@ int CJabberProto::RcGetUnreadEventsCount()
for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
DB::EventInfo dbei(hDbEvent);
- if (dbei && dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_READ) && !(dbei.flags & DBEF_SENT)) {
+ if (dbei && dbei.eventType == EVENTTYPE_MESSAGE && !dbei.bRead && !dbei.bSent) {
ptrW szEventText(dbei.getText());
if (szEventText)
nEventsSent++;
@@ -549,7 +549,7 @@ int CJabberProto::AdhocForwardHandler(const TiXmlElement*, CJabberIqInfo *pInfo,
addressesNode << XCHILD("address") << XATTR("type", "ofrom") << XATTR("jid", szOFrom);
addressesNode << XCHILD("address") << XATTR("type", "oto") << XATTR("jid", m_ThreadInfo->fullJID);
- time_t ltime = (time_t)dbei.timestamp;
+ time_t ltime = dbei.getUnixtime();
struct tm *gmt = gmtime(&ltime);
char stime[512];
mir_snprintf(stime, "%.4i-%.2i-%.2iT%.2i:%.2i:%.2iZ", gmt->tm_year + 1900, gmt->tm_mon + 1, gmt->tm_mday,
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 3dd0b1d547..12106c3552 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -1021,7 +1021,7 @@ uint32_t JabberGetLastContactMessageTime(MCONTACT hContact)
return 0;
DB::EventInfo dbei(hDbEvent, false);
- return (dbei) ? dbei.timestamp : 0;
+ return (dbei) ? dbei.getUnixtime() : 0;
}
MCONTACT CJabberProto::CreateTemporaryContact(const char *szJid, JABBER_LIST_ITEM *chatItem)
@@ -1175,7 +1175,7 @@ void CJabberProto::XmppMsg::handle_chatstates()
_dbei.cbBlob = 1;
_dbei.eventType = EVENTTYPE_JABBER_CHATSTATES;
_dbei.flags = DBEF_READ;
- _dbei.timestamp = time(0);
+ _dbei.iTimestamp = time(0);
_dbei.szModule = m_proto->m_szModuleName;
db_event_add(hContact, &_dbei);
}
@@ -1463,7 +1463,7 @@ void CJabberProto::XmppMsg::add_to_db()
if (bWasSent)
dbei.flags |= DBEF_SENT;
- dbei.timestamp = (uint32_t)msgTime;
+ dbei.iTimestamp = (uint32_t)msgTime;
dbei.pBlob = szMessage.GetBuffer();
dbei.szId = szMamMsgId;
diff --git a/protocols/NewsAggregator/Src/CheckFeed.cpp b/protocols/NewsAggregator/Src/CheckFeed.cpp
index b15724266c..954760298d 100644
--- a/protocols/NewsAggregator/Src/CheckFeed.cpp
+++ b/protocols/NewsAggregator/Src/CheckFeed.cpp
@@ -171,7 +171,7 @@ static void XmlToMsg(MCONTACT hContact, CMStringW &title, CMStringW &link, CMStr
db_event_get(hDbEvent, &olddbei);
// there's no need to look for the elder events
- if (stamp > 0 && olddbei.timestamp < (uint32_t)stamp)
+ if (stamp > 0 && olddbei.getUnixtime() < (uint32_t)stamp)
break;
if ((int)mir_strlen((char*)olddbei.pBlob) == cbOrigLen && !mir_strcmp((char*)olddbei.pBlob, pszTemp)) {
@@ -188,7 +188,7 @@ static void XmlToMsg(MCONTACT hContact, CMStringW &title, CMStringW &link, CMStr
T2Utf pszMessage(message);
DB::EventInfo dbei;
- dbei.timestamp = (uint32_t)stamp;
+ dbei.iTimestamp = (uint32_t)stamp;
dbei.pBlob = pszMessage;
ProtoChainRecvMsg(hContact, dbei);
}
diff --git a/protocols/Sametime/src/files.cpp b/protocols/Sametime/src/files.cpp
index d5c375682d..a4f662c566 100644
--- a/protocols/Sametime/src/files.cpp
+++ b/protocols/Sametime/src/files.cpp
@@ -37,7 +37,7 @@ void mwFileTransfer_offered(mwFileTransfer* ft)
strncpy_s(description, filename, _TRUNCATE);
DB::EventInfo dbei;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
ProtoChainRecvFile(hContact, DB::FILE_BLOB(ft, filename, description), dbei);
}
diff --git a/protocols/Sametime/src/messaging.cpp b/protocols/Sametime/src/messaging.cpp
index 15650b9c6f..d960d30e51 100644
--- a/protocols/Sametime/src/messaging.cpp
+++ b/protocols/Sametime/src/messaging.cpp
@@ -82,7 +82,7 @@ void mwIm_conversation_recv(mwConversation* conv, mwImSendType type, gconstpoint
return;
DB::EventInfo dbei;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
dbei.pBlob = (char*)msg;
ProtoChainRecvMsg(hContact, dbei);
}
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp
index 4089066833..a96a25262d 100644
--- a/protocols/SkypeWeb/src/skype_contacts.cpp
+++ b/protocols/SkypeWeb/src/skype_contacts.cpp
@@ -131,7 +131,7 @@ void CSkypeProto::LoadContactsAuth(MHttpResponse *response, AsyncHttpRequest*)
DB::AUTH_BLOB blob(hContact, displayName.c_str(), nullptr, nullptr, skypeId.c_str(), reason.c_str());
DB::EventInfo dbei;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
dbei.cbBlob = blob.size();
dbei.pBlob = blob;
ProtoChainRecv(hContact, PSR_AUTH, 0, (LPARAM)&dbei);
diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp
index 4861c621c3..d455eaf0e5 100644
--- a/protocols/SkypeWeb/src/skype_history_sync.cpp
+++ b/protocols/SkypeWeb/src/skype_history_sync.cpp
@@ -59,7 +59,7 @@ void CSkypeProto::OnGetServerHistory(MHttpResponse *response, AsyncHttpRequest *
DB::EventInfo dbei(db_event_getById(m_szModuleName, szMessageId));
dbei.hContact = hContact;
dbei.szModule = m_szModuleName;
- dbei.timestamp = (bUseLocalTime) ? iLocalTime : IsoToUnixTime(message["composetime"].as_string());
+ dbei.iTimestamp = (bUseLocalTime) ? iLocalTime : IsoToUnixTime(message["composetime"].as_string());
dbei.szId = szMessageId;
if (iUserType == 19) {
dbei.szUserId = szFrom;
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp
index d944390d5e..c108cef65d 100644
--- a/protocols/SkypeWeb/src/skype_messages.cpp
+++ b/protocols/SkypeWeb/src/skype_messages.cpp
@@ -119,7 +119,7 @@ LBL_Deleted:
}
if (strMessageType == "Text" || strMessageType == "RichText") {
- if ((dbei.flags & DBEF_SENT) && dbei.szId) {
+ if (dbei.bSent && dbei.szId) {
for (auto &it: m_OutMessages) {
if (it->hClientMessageId == _atoi64(dbei.szId)) {
ProtoBroadcastAck(dbei.hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)it->hMessage, (LPARAM)dbei.szId);
@@ -191,7 +191,7 @@ void CSkypeProto::ProcessNewMessage(const JSONNode &node)
DB::EventInfo dbei(db_event_getById(m_szModuleName, szMessageId));
dbei.hContact = hContact;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
dbei.szId = szMessageId;
dbei.flags = DBEF_UTF;
if (IsMe(szFromSkypename))
diff --git a/protocols/Steam/src/steam_chats.cpp b/protocols/Steam/src/steam_chats.cpp
index 650e1bcfe1..248233166f 100644
--- a/protocols/Steam/src/steam_chats.cpp
+++ b/protocols/Steam/src/steam_chats.cpp
@@ -130,7 +130,7 @@ void CSteamProto::OnGetChatHistory(const CChatRoomGetMessageHistoryResponse &rep
dbei.szModule = m_szModuleName;
replaceStr(dbei.pBlob, mir_strdup(pMsg->message));
dbei.cbBlob = (int)mir_strlen(dbei.pBlob);
- dbei.timestamp = pMsg->server_timestamp;
+ dbei.iTimestamp = pMsg->server_timestamp;
dbei.szId = szMsgId;
dbei.szUserId = szUserId;
@@ -163,7 +163,7 @@ void CSteamProto::OnGetChatMessage(const CChatRoomIncomingChatMessageNotificatio
dbei.szModule = m_szModuleName;
replaceStr(dbei.pBlob, mir_strdup(reply.message));
dbei.cbBlob = (int)mir_strlen(dbei.pBlob);
- dbei.timestamp = reply.timestamp;
+ dbei.iTimestamp = reply.timestamp;
dbei.szId = szMsgId;
dbei.szUserId = szUserId;
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp
index 2cdbdf4ccd..5ce9381f04 100644
--- a/protocols/Steam/src/steam_contacts.cpp
+++ b/protocols/Steam/src/steam_contacts.cpp
@@ -281,7 +281,7 @@ void CSteamProto::ContactIsAskingAuth(MCONTACT hContact)
DB::AUTH_BLOB blob(hContact, nickName, firstName, lastName, steamId, reason);
DB::EventInfo dbei;
- dbei.timestamp = now();
+ dbei.iTimestamp = now();
dbei.pBlob = blob;
dbei.cbBlob = blob.size();
ProtoChainRecv(hContact, PSR_AUTH, 0, (LPARAM)&dbei);
diff --git a/protocols/Steam/src/steam_history.cpp b/protocols/Steam/src/steam_history.cpp
index 65c77f490c..c94a0d6b0f 100644
--- a/protocols/Steam/src/steam_history.cpp
+++ b/protocols/Steam/src/steam_history.cpp
@@ -41,9 +41,9 @@ void CSteamProto::OnGotRecentMessages(const CFriendMessagesGetRecentMessagesResp
setDword(hContact, DBKEY_LASTMSG, pMsg->timestamp);
dbei.szId = szMsgId;
- dbei.timestamp = pMsg->timestamp;
+ dbei.iTimestamp = pMsg->timestamp;
}
- else dbei.timestamp = time(0);
+ else dbei.iTimestamp = time(0);
if (dbei.getEvent())
db_event_edit(hEvent, &dbei, true);
@@ -107,10 +107,10 @@ void CSteamProto::OnGotHistoryMessages(const CMsgClientChatGetFriendMessageHisto
dbei.cbBlob = (int)mir_strlen(pMsg->message);
dbei.pBlob = mir_strdup(pMsg->message);
if (pMsg->has_timestamp) {
- dbei.timestamp = pMsg->timestamp;
+ dbei.iTimestamp = pMsg->timestamp;
dbei.szId = szMsgId;
}
- else dbei.timestamp = time(0);
+ else dbei.iTimestamp = time(0);
if (dbei.getEvent())
db_event_edit(hEvent, &dbei, true);
diff --git a/protocols/Steam/src/steam_messages.cpp b/protocols/Steam/src/steam_messages.cpp
index da65a5b424..956b1a07db 100644
--- a/protocols/Steam/src/steam_messages.cpp
+++ b/protocols/Steam/src/steam_messages.cpp
@@ -49,7 +49,7 @@ void CSteamProto::OnGotIncomingMessage(const CFriendMessagesIncomingMessageNotif
dbei.flags |= DBEF_SENT;
dbei.cbBlob = (int)mir_strlen(reply.message);
dbei.pBlob = reply.message;
- dbei.timestamp = reply.has_rtime32_server_timestamp ? reply.rtime32_server_timestamp : time(0);
+ dbei.iTimestamp = reply.has_rtime32_server_timestamp ? reply.rtime32_server_timestamp : time(0);
ProtoChainRecvMsg(hContact, dbei);
}
break;
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp
index f8cee175d0..7fd3eb4d92 100644
--- a/protocols/Steam/src/steam_proto.cpp
+++ b/protocols/Steam/src/steam_proto.cpp
@@ -304,7 +304,7 @@ int CSteamProto::OnPreCreateMessage(WPARAM, LPARAM lParam)
if (!mir_strcmp(Proto_GetBaseAccountName(evt->hContact), m_szModuleName)) {
mir_cslock lck(m_csOwnMessages);
if (auto *pOwn = m_arOwnMessages.find((COwnMessage *)&evt->seq)) {
- evt->dbei->timestamp = pOwn->timestamp;
+ evt->dbei->iTimestamp = pOwn->timestamp;
m_arOwnMessages.remove(pOwn);
}
}
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp
index b0ce821946..d8d6f3a842 100644
--- a/protocols/Telegram/src/proto.cpp
+++ b/protocols/Telegram/src/proto.cpp
@@ -462,7 +462,7 @@ void CTelegramProto::ProcessFileMessage(TG_FILE_REQUEST *ft, const TD::message *
dbei.szModule = Proto_GetBaseAccountName(ft->m_hContact);
dbei.eventType = EVENTTYPE_FILE;
dbei.flags = DBEF_SENT | DBEF_UTF;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
TG_FILE_REQUEST localft(TG_FILE_REQUEST::FILE, 0, 0);
localft.m_fileName = Utf2T(pFile->local_->path_.c_str());
diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp
index 495d46523b..abcd38b677 100644
--- a/protocols/Telegram/src/server.cpp
+++ b/protocols/Telegram/src/server.cpp
@@ -465,7 +465,7 @@ void CTelegramProto::OnGetHistory(td::ClientManager::Response &response, void *p
DBEVENTINFO dbei = {};
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.szModule = m_szModuleName;
- dbei.timestamp = pMsg->date_;
+ dbei.iTimestamp = pMsg->date_;
dbei.cbBlob = szBody.GetLength();
dbei.pBlob = szBody.GetBuffer();
dbei.szId = szMsgId;
@@ -990,7 +990,7 @@ void CTelegramProto::ProcessMessage(const TD::message *pMessage)
DB::EventInfo dbei(hOldEvent);
dbei.szId = szMsgId;
dbei.cbBlob = szText.GetLength();
- dbei.timestamp = pMessage->date_;
+ dbei.iTimestamp = pMessage->date_;
if (pMessage->is_outgoing_)
dbei.flags |= DBEF_SENT;
if (!pUser->bInited)
diff --git a/protocols/Telegram/src/utils.cpp b/protocols/Telegram/src/utils.cpp
index 240322d81e..3d33b6b0c8 100644
--- a/protocols/Telegram/src/utils.cpp
+++ b/protocols/Telegram/src/utils.cpp
@@ -217,8 +217,7 @@ void CTelegramProto::MarkRead(MCONTACT hContact, const CMStringA &szMaxId, bool
if (dbei.szId > szMaxId)
break;
- bool isSent = (dbei.flags & DBEF_SENT) != 0;
- if (isSent != bSent)
+ if (dbei.bSent != bSent)
continue;
if (!dbei.markedRead())
@@ -462,7 +461,7 @@ bool CTelegramProto::GetMessageFile(const EmbeddedFile &F, TG_FILE_REQUEST::Type
DB::EventInfo dbei(db_event_getById(m_szModuleName, F.pszId));
dbei.flags = DBEF_TEMPORARY;
- dbei.timestamp = F.pMsg->date_;
+ dbei.iTimestamp = F.pMsg->date_;
dbei.szId = F.pszId;
dbei.szUserId = F.pszUser;
if (F.pMsg->is_outgoing_)
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp
index 869386523c..d5d5496135 100644
--- a/protocols/Tox/src/tox_contacts.cpp
+++ b/protocols/Tox/src/tox_contacts.cpp
@@ -235,7 +235,7 @@ void CToxProto::OnFriendRequest(Tox*, const uint8_t *pubKey, const uint8_t *mess
DB::AUTH_BLOB blob(hContact, nullptr, nullptr, nullptr, (LPCSTR)address, (LPCSTR)message);
DB::EventInfo dbei;
- dbei.timestamp = now();
+ dbei.iTimestamp = now();
dbei.cbBlob = blob.size();
dbei.pBlob = blob;
ProtoChainRecv(hContact, PSR_AUTH, 0, (LPARAM)&dbei);
diff --git a/protocols/Tox/src/tox_messages.cpp b/protocols/Tox/src/tox_messages.cpp
index 74994f6ddd..c79be54f6e 100644
--- a/protocols/Tox/src/tox_messages.cpp
+++ b/protocols/Tox/src/tox_messages.cpp
@@ -52,7 +52,7 @@ void CToxProto::OnFriendMessage(Tox *tox, uint32_t friendNumber, TOX_MESSAGE_TYP
rawMessage[length] = 0;
DB::EventInfo dbei;
- dbei.timestamp = now();
+ dbei.iTimestamp = now();
dbei.pBlob = rawMessage;
switch (type) {
case TOX_MESSAGE_TYPE_NORMAL:
diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp
index 1b7b6e4fc3..15b11d062f 100644
--- a/protocols/Tox/src/tox_transfer.cpp
+++ b/protocols/Tox/src/tox_transfer.cpp
@@ -51,7 +51,7 @@ void CToxProto::OnFriendFile(Tox *tox, uint32_t friendNumber, uint32_t fileNumbe
proto->transfers.Add(transfer);
DB::EventInfo dbei;
- dbei.timestamp = now();
+ dbei.iTimestamp = now();
ProtoChainRecvFile(hContact, DB::FILE_BLOB(transfer, rawName), dbei);
}
break;
diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp
index 7b7c39bfa8..51d6859f5d 100644
--- a/protocols/Tox/src/tox_utils.cpp
+++ b/protocols/Tox/src/tox_utils.cpp
@@ -130,7 +130,7 @@ MEVENT CToxProto::AddEventToDb(MCONTACT hContact, uint16_t type, uint32_t timest
{
DBEVENTINFO dbei = {};
dbei.szModule = m_szModuleName;
- dbei.timestamp = timestamp;
+ dbei.iTimestamp = timestamp;
dbei.eventType = type;
dbei.cbBlob = (uint32_t)cbBlob;
dbei.pBlob = pBlob;
diff --git a/protocols/Twitter/src/connection.cpp b/protocols/Twitter/src/connection.cpp
index c5f0b48adf..34f7093a31 100644
--- a/protocols/Twitter/src/connection.cpp
+++ b/protocols/Twitter/src/connection.cpp
@@ -405,7 +405,7 @@ void CTwitterProto::UpdateStatuses(bool pre_read, bool popups, bool tweetToMsg)
dbei.cbBlob = (int)u->status.text.length() + 1;
dbei.eventType = TWITTER_DB_EVENT_TYPE_TWEET;
dbei.flags = DBEF_UTF;
- dbei.timestamp = static_cast<uint32_t>(u->status.time);
+ dbei.iTimestamp = static_cast<uint32_t>(u->status.time);
dbei.szModule = m_szModuleName;
db_event_add(hContact, &dbei);
}
@@ -478,7 +478,7 @@ void CTwitterProto::UpdateMessages(bool pre_read)
if (bIsMe)
recv.flags |= PREF_SENT;
recv.szMessage = const_cast<char*>(text.c_str());
- recv.timestamp = static_cast<uint32_t>(time);
+ recv.iTimestamp = static_cast<uint32_t>(time);
recv.szMsgId = msgid.c_str();
MEVENT hDbEVent = (MEVENT)ProtoChainRecvMsg(hContact, &recv);
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 422026cdd1..35780ca621 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -719,7 +719,7 @@ void CVkProto::DBAddAuthRequest(const MCONTACT hContact, bool added)
DBEVENTINFO dbei = {};
dbei.szModule = m_szModuleName;
- dbei.timestamp = (uint32_t)time(0);
+ dbei.iTimestamp = (uint32_t)time(0);
dbei.flags = DBEF_UTF;
dbei.eventType = added ? EVENTTYPE_ADDED : EVENTTYPE_AUTHREQUEST;
dbei.cbBlob = blob.size();
@@ -1962,7 +1962,7 @@ void CVkProto::AddVkDeactivateEvent(MCONTACT hContact, CMStringW& wszType)
DBEVENTINFO dbei = {};
dbei.szModule = m_szModuleName;
- dbei.timestamp = time(0);
+ dbei.iTimestamp = time(0);
dbei.eventType = VK_USER_DEACTIVATE_ACTION;
ptrA pszDescription(mir_utf8encode(vkDeactivateEvent[iDEIdx].szDescription));
dbei.cbBlob = (uint32_t)mir_strlen(pszDescription) + 1;
@@ -1995,7 +1995,7 @@ MEVENT CVkProto::GetMessageFromDb(const char *szMessageId, time_t& tTimeStamp, C
DB::EventInfo dbei(hDbEvent);
wszMsg = ptrW(mir_utf8decodeW((char*)dbei.pBlob));
- tTimeStamp = dbei.timestamp;
+ tTimeStamp = dbei.getUnixtime();
return hDbEvent;
}
@@ -2023,7 +2023,7 @@ bool CVkProto::IsMessageExist(VKMessageID_t iMessageId, VKMesType vkType)
if(db_event_get(hDbEvent, &dbei))
return false;
- return ((vkType == vkOUT) == (bool)(dbei.flags & DBEF_SENT));
+ return ((vkType == vkOUT) == dbei.bSent);
}
CMStringW CVkProto::UserProfileUrl(VKUserID_t iUserId)
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp
index 4f3ed443ba..979624a17d 100644
--- a/protocols/VKontakte/src/vk_chats.cpp
+++ b/protocols/VKontakte/src/vk_chats.cpp
@@ -577,7 +577,7 @@ void CVkProto::AppendChatMessage(CVkChatInfo* vkChatInfo, VKMessageID_t iMessage
DB::EventInfo dbei;
dbei.szId = szMid;
- dbei.timestamp = tMsgTime;
+ dbei.iTimestamp = tMsgTime;
dbei.pBlob = pszBody;
if (iUserId == m_iMyUserId)
dbei.flags |= DBEF_SENT;
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp
index 33b4c3cd11..be05063ca0 100644
--- a/protocols/VKontakte/src/vk_feed.cpp
+++ b/protocols/VKontakte/src/vk_feed.cpp
@@ -56,7 +56,7 @@ void CVkProto::AddFeedEvent(CVKNewsItem& vkNewsItem)
T2Utf pszBody(vkNewsItem.wszText);
DB::EventInfo dbei;
- dbei.timestamp = vkNewsItem.tDate;
+ dbei.iTimestamp = vkNewsItem.tDate;
dbei.pBlob = pszBody;
if (m_vkOptions.bUseNonStandardNotifications) {
@@ -868,7 +868,7 @@ void CVkProto::NewsClearHistory()
while (MEVENT hDbEvent = pCursor.FetchNext()) {
DBEVENTINFO dbei = {};
db_event_get(hDbEvent, &dbei);
- if (dbei.timestamp < tTime)
+ if (dbei.getUnixtime() < tTime)
pCursor.DeleteEvent();
}
} \ No newline at end of file
diff --git a/protocols/VKontakte/src/vk_history.cpp b/protocols/VKontakte/src/vk_history.cpp
index a69883a117..23cbc6f821 100644
--- a/protocols/VKontakte/src/vk_history.cpp
+++ b/protocols/VKontakte/src/vk_history.cpp
@@ -116,7 +116,7 @@ void CVkProto::GetServerHistoryLastNDay(MCONTACT hContact, int iNDay)
while (MEVENT hDbEvent = pCursor.FetchNext()) {
DBEVENTINFO dbei = {};
db_event_get(hDbEvent, &dbei);
- if (dbei.timestamp > tTime && dbei.eventType != VK_USER_DEACTIVATE_ACTION)
+ if (dbei.getUnixtime() > tTime && dbei.eventType != VK_USER_DEACTIVATE_ACTION)
pCursor.DeleteEvent();
}
@@ -322,7 +322,7 @@ void CVkProto::OnReceiveHistoryMessages(MHttpResponse *reply, AsyncHttpRequest *
T2Utf pszBody(wszBody);
- dbei.timestamp = tDateTime;
+ dbei.iTimestamp = tDateTime;
dbei.pBlob = pszBody;
dbei.szId = szMid;
diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp
index 3af8146ed8..03f842609f 100644
--- a/protocols/VKontakte/src/vk_messages.cpp
+++ b/protocols/VKontakte/src/vk_messages.cpp
@@ -60,10 +60,10 @@ int CVkProto::ForwardMsg(MCONTACT hContact, std::vector<MEVENT>& vForvardEvents,
continue;
if (!Proto_IsProtoOnContact(dbei.hContact, m_szModuleName)) {
- CMStringW wszContactName = (dbei.flags & DBEF_SENT) ? getWStringA(0, "Nick", TranslateT("Me")) : Clist_GetContactDisplayName(dbei.hContact);
+ CMStringW wszContactName = (dbei.bSent) ? getWStringA(0, "Nick", TranslateT("Me")) : Clist_GetContactDisplayName(dbei.hContact);
wchar_t ttime[64];
- time_t tTimestamp(dbei.timestamp);
+ time_t tTimestamp(dbei.getUnixtime());
_locale_t locale = _create_locale(LC_ALL, "");
_wcsftime_l(ttime, _countof(ttime), TranslateT("%x at %X"), localtime(&tTimestamp), locale);
_free_locale(locale);
@@ -489,7 +489,7 @@ void CVkProto::OnReceiveMessages(MHttpResponse *reply, AsyncHttpRequest *pReq)
SetInvisible(hContact);
T2Utf pszBody(wszBody);
- dbei.timestamp = bEdited ? tDateTime : (m_vkOptions.bUseLocalTime ? time(0) : tDateTime);
+ dbei.iTimestamp = bEdited ? tDateTime : (m_vkOptions.bUseLocalTime ? time(0) : tDateTime);
dbei.pBlob = pszBody;
if (!m_vkOptions.bShowReplyInMessage && szReplyId) {
@@ -518,7 +518,7 @@ void CVkProto::OnReceiveMessages(MHttpResponse *reply, AsyncHttpRequest *pReq)
debugLogA("CVkProto::OnReceiveMessages add attachments");
T2Utf pszAttach(wszAttachmentDescr);
- dbei.timestamp = isOut ? time(0) : tDateTime;
+ dbei.iTimestamp = isOut ? time(0) : tDateTime;
dbei.pBlob = pszAttach;
dbei.szId = strcat(szMid, "_");
ProtoChainRecvMsg(hContact, dbei);
diff --git a/protocols/VKontakte/src/vk_pollserver.cpp b/protocols/VKontakte/src/vk_pollserver.cpp
index adb4ee0580..f462df0d7b 100644
--- a/protocols/VKontakte/src/vk_pollserver.cpp
+++ b/protocols/VKontakte/src/vk_pollserver.cpp
@@ -143,7 +143,7 @@ void CVkProto::PollUpdates(const JSONNode &jnUpdates)
_itoa(iMessageId, szMid, 10);
T2Utf pszMsg(wszMsg);
- dbei.timestamp = tDateTime;
+ dbei.iTimestamp = tDateTime;
dbei.pBlob = pszMsg;
dbei.szId = szMid;
ProtoChainRecvMsg(hContact, dbei);
diff --git a/protocols/Weather/src/weather_update.cpp b/protocols/Weather/src/weather_update.cpp
index fc71bfc0a7..f872d2031f 100644
--- a/protocols/Weather/src/weather_update.cpp
+++ b/protocols/Weather/src/weather_update.cpp
@@ -189,7 +189,7 @@ int UpdateWeather(MCONTACT hContact)
DBEVENTINFO dbei = {};
dbei.szModule = MODULENAME;
- dbei.timestamp = (uint32_t)time(0);
+ dbei.iTimestamp = (uint32_t)time(0);
dbei.flags = DBEF_READ | DBEF_UTF;
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.pBlob = szMessage;
diff --git a/protocols/WhatsApp/src/appsync.cpp b/protocols/WhatsApp/src/appsync.cpp
index 145acd39f0..d293e7e177 100644
--- a/protocols/WhatsApp/src/appsync.cpp
+++ b/protocols/WhatsApp/src/appsync.cpp
@@ -275,7 +275,7 @@ void WhatsAppProto::ProcessHistorySync(const Wa__HistorySync *pSync)
auto *key = pMessage->message->key;
DB::EventInfo dbei;
- dbei.timestamp = pMessage->message->messagetimestamp;
+ dbei.iTimestamp = pMessage->message->messagetimestamp;
dbei.pBlob = szMessageText.GetBuffer();
dbei.szId = key->id;
dbei.flags = DBEF_READ;
diff --git a/protocols/WhatsApp/src/message.cpp b/protocols/WhatsApp/src/message.cpp
index 199b7b16fa..008452a7d9 100644
--- a/protocols/WhatsApp/src/message.cpp
+++ b/protocols/WhatsApp/src/message.cpp
@@ -212,7 +212,7 @@ void WhatsAppProto::ProcessMessage(WAMSG type, const Wa__WebMessageInfo &msg)
// for chats & group chats store message in profile
if (type.bPrivateChat || type.bGroupChat) {
DB::EventInfo dbei;
- dbei.timestamp = timestamp;
+ dbei.iTimestamp = timestamp;
dbei.pBlob = szMessageText.GetBuffer();
dbei.szId = msgId;
if (type.bOffline)