diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2021-09-12 10:04:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-12 10:04:21 +0200 |
commit | a76ed82eb298d30c7b654c74378f93a9a35580a6 (patch) | |
tree | 9359d204c59561f0c9ba12810c7b7fae88eaae07 /lib/room.cpp | |
parent | 41944ac3ee76029201c2108a063ae2b6354f6a22 (diff) | |
parent | 0209be8305aa38722a3d25593ae71fbb3ac05e52 (diff) | |
download | libquotient-a76ed82eb298d30c7b654c74378f93a9a35580a6.tar.gz libquotient-a76ed82eb298d30c7b654c74378f93a9a35580a6.zip |
Merge pull request #506 from TobiasFella/activateencryption
Add convenience function for activating encryption
Diffstat (limited to 'lib/room.cpp')
-rw-r--r-- | lib/room.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index bcbb121b..fb65fd84 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -3020,3 +3020,12 @@ bool MemberSorter::operator()(User* u1, QStringView u2name) const return n1.localeAwareCompare(n2) < 0; } + +void Room::activateEncryption() +{ + if(usesEncryption()) { + qCWarning(E2EE) << "Room" << objectName() << "is already encrypted"; + return; + } + setState<EncryptionEvent>(EncryptionEventContent::MegolmV1AesSha2); +} |