From 3d30ed65f9e226b7b183b23ce5dba435ec491f0b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 10 Jan 2025 18:28:28 +0300 Subject: DBEVENTINFO::timestamp to become 64-bit integer --- plugins/Import/src/textjson.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'plugins/Import/src/textjson.cpp') diff --git a/plugins/Import/src/textjson.cpp b/plugins/Import/src/textjson.cpp index 3cfa254c8f..c78e031099 100644 --- a/plugins/Import/src/textjson.cpp +++ b/plugins/Import/src/textjson.cpp @@ -112,7 +112,7 @@ public: auto &node = *pNode; dbei->eventType = node["type"].as_int(); - dbei->timestamp = 0; + dbei->iTimestamp = 0; std::string szTime = node["time"].as_string(); if (!szTime.empty()) { char c; @@ -123,7 +123,7 @@ public: st.tm_year -= 1900; time_t tm = mktime(&st); if (tm != -1) - dbei->timestamp = tm; + dbei->iTimestamp = tm; } } else { @@ -136,13 +136,13 @@ public: st.tm_year -= 1900; time_t tm = _mkgmtime(&st); if (tm != -1) - dbei->timestamp = tm; + dbei->iTimestamp = tm; } } } - if (dbei->timestamp == 0) - dbei->timestamp = node["timeStamp"].as_int(); + if (dbei->iTimestamp == 0) + dbei->iTimestamp = node["timeStamp"].as_int(); dbei->flags = 0; std::string szFlags = node["flags"].as_string(); @@ -343,16 +343,16 @@ public: if (mir_strcmp(dbei.szModule, szProto)) pRoot.push_back(JSONNode("module", dbei.szModule)); - pRoot.push_back(JSONNode("timestamp", dbei.timestamp)); + pRoot.push_back(JSONNode("timestamp", dbei.getUnixtime())); wchar_t szTemp[500]; - TimeZone_PrintTimeStamp(UTC_TIME_HANDLE, dbei.timestamp, L"I", szTemp, _countof(szTemp), 0); + TimeZone_PrintTimeStamp(UTC_TIME_HANDLE, dbei.getUnixtime(), L"I", szTemp, _countof(szTemp), 0); pRoot.push_back(JSONNode("isotime", T2Utf(szTemp).get())); std::string flags; - if (dbei.flags & DBEF_SENT) + if (dbei.bSent) flags += "m"; - if (dbei.flags & DBEF_READ) + if (dbei.bRead) flags += "r"; pRoot.push_back(JSONNode("flags", flags)); -- cgit v1.2.3