crypto: Disable the creation of encrypted event content for now.

It isn't possible to encrypted events using ruma anymore. This will need
to be re-enabled once ruma gets back support for this.
master
Damir Jelić 2020-05-04 14:12:42 +02:00
parent 704d8bc0ed
commit 86dc1ce3ca
2 changed files with 15 additions and 10 deletions

View File

@ -532,12 +532,15 @@ impl Client {
) -> Result<MessageEventContent> {
let mut olm = self.olm.lock().await;
match &mut *olm {
Some(o) => Ok(MessageEventContent::Encrypted(
o.encrypt(room_id, content).await?,
)),
None => panic!("Olm machine wasn't started"),
}
// TODO enable this again once we can send encrypted event
// contents with ruma.
// match &mut *olm {
// Some(o) => Ok(MessageEventContent::Encrypted(
// o.encrypt(room_id, content).await?,
// )),
// None => panic!("Olm machine wasn't started"),
// }
Ok(content)
}
/// Get a tuple of device and one-time keys that need to be uploaded.

View File

@ -1290,10 +1290,12 @@ impl OlmMachine {
)
.await?;
user_messages.insert(
DeviceIdOrAllDevices::DeviceId(device.device_id().clone()),
EventJson::from(MessageEventContent::Encrypted(encrypted_content)),
);
// TODO enable this again once we can send encrypted event
// contents with ruma.
// user_messages.insert(
// DeviceIdOrAllDevices::DeviceId(device.device_id().clone()),
// EventJson::from(MessageEventContent::Encrypted(encrypted_content)),
// );
}
message_vec.push(ToDeviceRequest {