some refactoring, some improvements

This commit is contained in:
Blue 2023-11-10 19:26:16 -03:00
parent be466fbad1
commit e31ef78e71
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
13 changed files with 188 additions and 147 deletions

View file

@ -136,6 +136,14 @@ enum class Support {
};
Q_ENUM_NS(Support)
enum class Possible {
unknown,
discovering,
present,
abscent
};
Q_ENUM_NS(Possible)
enum class TrustLevel {
/// The key's trust is not decided.
undecided,

View file

@ -268,7 +268,9 @@ QDataStream& operator<<(QDataStream& out, const Shared::Message& info) {
out << info.rTo;
out << info.id;
out << info.body;
out << info.time;
quint64 msecs = info.time.toMSecsSinceEpoch();
out << msecs;
out << info.thread;
out << (quint8)info.type;
out << info.outgoing;
@ -297,7 +299,11 @@ QDataStream & operator>>(QDataStream& in, Shared::Message& info) {
in >> info.rTo;
in >> info.id;
in >> info.body;
in >> info.time;
quint64 msecs;
in >> msecs;
info.time = QDateTime::fromMSecsSinceEpoch(msecs);
in >> info.thread;
quint8 t;
in >> t;