Merge branch 'room-fix-send-unencrypted' into 'master'
[Room] Send unencrypted if encryption not enabled Closes #53 See merge request famedly/famedlysdk!209
This commit is contained in:
commit
ce1fd3ecd8
|
@ -1476,8 +1476,7 @@ class Room {
|
||||||
Future<Map<String, dynamic>> encryptGroupMessagePayload(
|
Future<Map<String, dynamic>> encryptGroupMessagePayload(
|
||||||
Map<String, dynamic> payload,
|
Map<String, dynamic> payload,
|
||||||
{String type = "m.room.message"}) async {
|
{String type = "m.room.message"}) async {
|
||||||
if (!this.encrypted) return payload;
|
if (!this.encrypted || !client.encryptionEnabled) return payload;
|
||||||
if (!client.encryptionEnabled) throw ("Encryption is not enabled");
|
|
||||||
if (this.encryptionAlgorithm != "m.megolm.v1.aes-sha2") {
|
if (this.encryptionAlgorithm != "m.megolm.v1.aes-sha2") {
|
||||||
throw ("Unknown encryption algorithm");
|
throw ("Unknown encryption algorithm");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue