cant believe it, first ever encrypted messages!

This commit is contained in:
Blue 2023-11-05 16:29:44 -03:00
parent a7d1a28f29
commit 637eb702a8
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
10 changed files with 190 additions and 69 deletions

View file

@ -247,6 +247,19 @@ void Shared::Message::setEdited(bool p_edited) {
edited = p_edited;
}
Shared::EncryptionProtocol Shared::Message::getEncryption() const {
return encryption;
}
void Shared::Message::setEncryption(EncryptionProtocol encryption) {
Shared::Message::encryption = encryption;
}
void Shared::Message::setError(const QString& text) {
state = State::error;
errorText = text;
}
QDataStream& operator<<(QDataStream& out, const Shared::Message& info) {
out << info.jFrom;
out << info.rFrom;
@ -271,6 +284,7 @@ QDataStream& operator<<(QDataStream& out, const Shared::Message& info) {
}
out << info.stanzaId;
out << info.attachPath;
out << (quint8)info.encryption;
return out;
}
@ -303,6 +317,9 @@ QDataStream & operator>>(QDataStream& in, Shared::Message& info) {
}
in >> info.stanzaId;
in >> info.attachPath;
quint8 e;
in >> e;
info.encryption = static_cast<Shared::EncryptionProtocol>(e);
return in;
}