feat(eventsub): use special flag and timestamps from metadata (#5996)
This commit is contained in:
@@ -3,9 +3,11 @@
|
||||
#include "Application.hpp"
|
||||
#include "providers/twitch/TwitchCommon.hpp"
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QDirIterator>
|
||||
#include <QLocale>
|
||||
#include <QRegularExpression>
|
||||
#include <QTimeZone>
|
||||
#include <QUuid>
|
||||
|
||||
namespace {
|
||||
@@ -314,4 +316,21 @@ QLocale getSystemLocale()
|
||||
return QLocale::system();
|
||||
}
|
||||
|
||||
QDateTime chronoToQDateTime(std::chrono::system_clock::time_point time)
|
||||
{
|
||||
auto msSinceEpoch =
|
||||
std::chrono::time_point_cast<std::chrono::milliseconds>(time)
|
||||
.time_since_epoch();
|
||||
auto dt = QDateTime::fromMSecsSinceEpoch(msSinceEpoch.count());
|
||||
|
||||
#if CHATTERINO_WITH_TESTS
|
||||
if (getApp()->isTest())
|
||||
{
|
||||
dt = dt.toUTC();
|
||||
}
|
||||
#endif
|
||||
|
||||
return dt;
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
Reference in New Issue
Block a user