forked from blue/squawk
cant believe it, first ever encrypted messages!
This commit is contained in:
parent
a7d1a28f29
commit
637eb702a8
10 changed files with 190 additions and 69 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue