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

View File

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