some work towards encryption

This commit is contained in:
Blue 2023-11-04 22:12:15 -03:00
parent 297e08ba41
commit a7d1a28f29
Signed by: blue
GPG key ID: 9B203B252A63EE38
21 changed files with 129 additions and 81 deletions

View file

@ -561,12 +561,12 @@ Shared::Message Core::RosterItem::getMessage(const QString& id) {
return archive->getElement(id);
}
bool Core::RosterItem::isEncryptionEnabled() const {
return archive->isEncryptionEnabled();
Shared::EncryptionProtocol Core::RosterItem::encryption() const {
return archive->encryption();
}
void Core::RosterItem::enableEncryption(bool value) {
bool changed = archive->setEncryptionEnabled(value);
void Core::RosterItem::setEncryption(Shared::EncryptionProtocol value) {
bool changed = archive->setEncryption(value);
if (changed)
emit encryptionChanged(value);
}
@ -574,7 +574,7 @@ void Core::RosterItem::enableEncryption(bool value) {
QMap<QString, QVariant> Core::RosterItem::getInfo() const {
QMap<QString, QVariant> result({
{"name", name},
{"encryption", isEncryptionEnabled()},
{"encryption", QVariant::fromValue(encryption())},
});
Archive::AvatarInfo info;
bool hasAvatar = readAvatarInfo(info);