diff --git a/src/murmur/Messages.cpp b/src/murmur/Messages.cpp index c92e366b070..73b05994c8d 100644 --- a/src/murmur/Messages.cpp +++ b/src/murmur/Messages.cpp @@ -20,12 +20,13 @@ #include "Version.h" #include "crypto/CryptState.h" -#include -#include - #include #include +#include +#include +#include + #include #define RATELIMIT(user) \ @@ -687,7 +688,11 @@ void Server::msgBanList(ServerUser *uSource, MumbleProto::BanList &msg) { b.qsReason = u8(be.reason()); if (be.has_start()) { b.qdtStart = QDateTime::fromString(u8(be.start()), Qt::ISODate); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + b.qdtStart.setTimeZone(QTimeZone::UTC); +#else b.qdtStart.setTimeSpec(Qt::UTC); +#endif } else { b.qdtStart = QDateTime::currentDateTime().toUTC(); } diff --git a/src/murmur/ServerDB.cpp b/src/murmur/ServerDB.cpp index ffb655c2d64..4536641ea6c 100644 --- a/src/murmur/ServerDB.cpp +++ b/src/murmur/ServerDB.cpp @@ -3,14 +3,12 @@ // that can be found in the LICENSE file at the root of the // Mumble source tree or at . -#include +#include "ServerDB.h" #ifdef Q_OS_WIN # include "win.h" #endif -#include "ServerDB.h" - #include "ACL.h" #include "Channel.h" #include "Connection.h" @@ -22,12 +20,14 @@ #include "ServerUser.h" #include "User.h" +#include + #include +#include +#include #include #include -#include - #ifdef Q_OS_WIN # include #else @@ -1210,7 +1210,11 @@ QList< UserInfo > Server::getRegisteredUsersEx() { userinfo.name = query.value(1).toString(); userinfo.last_channel = query.value(2).toInt(); userinfo.last_active = QDateTime::fromString(query.value(3).toString(), Qt::ISODate); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + userinfo.last_active.setTimeZone(QTimeZone::UTC); +#else userinfo.last_active.setTimeSpec(Qt::UTC); +#endif users << userinfo; } @@ -2220,14 +2224,22 @@ int Server::readLastChannel(int id) { } QDateTime last_active = QDateTime::fromString(query.value(1).toString(), Qt::ISODate); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + last_active.setTimeZone(QTimeZone::UTC); +#else last_active.setTimeSpec(Qt::UTC); +#endif QDateTime last_disconnect; // NULL column for last_disconnect will yield an empty invalid QDateTime object. // Using that object with QDateTime::secsTo() will return 0 as per Qt specification. if (!query.value(2).isNull()) { last_disconnect = QDateTime::fromString(query.value(2).toString(), Qt::ISODate); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + last_disconnect.setTimeZone(QTimeZone::UTC); +#else last_disconnect.setTimeSpec(Qt::UTC); +#endif } if (last_active.secsTo(last_disconnect) <= 0) { @@ -2312,7 +2324,11 @@ void Server::getBans() { ban.qsHash = query.value(3).toString(); ban.qsReason = query.value(4).toString(); ban.qdtStart = query.value(5).toDateTime(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + ban.qdtStart.setTimeZone(QTimeZone::UTC); +#else ban.qdtStart.setTimeSpec(Qt::UTC); +#endif ban.iDuration = query.value(6).toUInt(); if (ban.isValid())