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;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#include <QMap>
|
||||
#include <QDataStream>
|
||||
|
||||
#include "enums.h"
|
||||
|
||||
namespace Shared {
|
||||
class Message;
|
||||
}
|
||||
|
@ -94,6 +96,9 @@ public:
|
|||
bool change(const QMap<QString, QVariant>& data);
|
||||
void setStanzaId(const QString& sid);
|
||||
void setAttachPath(const QString& path);
|
||||
void setEncryption(EncryptionProtocol encryption);
|
||||
|
||||
void setError(const QString& text);
|
||||
|
||||
QString getFrom() const;
|
||||
QString getFromJid() const;
|
||||
|
@ -123,6 +128,7 @@ public:
|
|||
QString getOriginalBody() const;
|
||||
QString getStanzaId() const;
|
||||
QString getAttachPath() const;
|
||||
EncryptionProtocol getEncryption() const;
|
||||
|
||||
private:
|
||||
QString jFrom;
|
||||
|
@ -144,6 +150,7 @@ private:
|
|||
QDateTime lastModified;
|
||||
QString stanzaId;
|
||||
QString attachPath;
|
||||
EncryptionProtocol encryption;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue