Finish 64-bit time conversion, modify protocol
authorShane Synan <digitalcircuit36939@gmail.com>
Fri, 11 May 2018 00:20:12 +0000 (19:20 -0500)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 23 May 2018 22:33:28 +0000 (00:33 +0200)
commit6a63070246d89aa2a2474e3a9a1035fa889ad77e
treef8adb0e56d38967ee24c28d6ad4ec3abbe872836
parentd09f943e9a6cb563b479bef5a4e909fbae6b768f
Finish 64-bit time conversion, modify protocol

Convert the remaining uses of 32-bit quint-based
"[to|from|set]Time_t()" to the modern 64-bit qint64-based
"[to|from|set]MSecsSinceEpoch()", handling the Y2038 problem while
also gaining higher precision in some places.

For places where seconds are needed, e.g. converting incoming time
from the IRC protocol, make use of "[to|set|from]SecsSinceEpoch()"
instead.  As this was only added in Qt 5.8, use the "QT_VERSION"
macro for backwards compatibility, manually dividing by 1000 for the
"MSecs" function equivalents.

Beware, all new code should use "[to|from|set]MSecsSinceEpoch()" and
NOT use "[to|from|set]Time_t()", or you'll re-introduce Y2038 bugs!

Modify protocol to rename "LongMessageTime" to "LongTime", and
send/receive all times as "qint64" instead of "quint64" or "quint".
"LongMessageTime" was never in Quassel git master, so renaming it
should have no impact.

Modify Event timing to be 64-bit compatible, too.

"IrcUser::lastAwayMessage()" will be fixed in a follow-up commit.

SQLite millisecond precision will be fixed in a follow-up commit.

See https://doc.qt.io/qt-5/qdatetime.html
And https://doc.qt.io/qt-5/datastreamformat.html
And https://doc.qt.io/qt-5/qdatetime-obsolete.html
16 files changed:
src/client/messagefilter.cpp
src/client/messagefilter.h
src/client/messagemodel.cpp
src/client/messagemodel.h
src/common/event.cpp
src/common/ircuser.cpp
src/common/message.cpp
src/common/quassel.cpp
src/common/quassel.h
src/core/core.cpp
src/core/corenetwork.cpp
src/core/corenetwork.h
src/core/coresessioneventprocessor.cpp
src/core/eventstringifier.cpp
src/core/postgresqlstorage.cpp
src/core/sqlitestorage.cpp