Upgrade ruma

master
Jonas Platte 2020-07-25 02:23:10 +02:00
parent bf54b17a2f
commit ca88539ec4
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
4 changed files with 9 additions and 15 deletions

View File

@ -966,18 +966,14 @@ impl Client {
/// # use futures::executor::block_on;
/// # use matrix_sdk::identifiers::RoomId;
/// # use std::convert::TryFrom;
/// use matrix_sdk::events::room::message::{FormattedBody, MessageEventContent, TextMessageEventContent};
/// use matrix_sdk::events::room::message::{MessageEventContent, TextMessageEventContent};
/// # block_on(async {
/// # let homeserver = Url::parse("http://localhost:8080").unwrap();
/// # let mut client = Client::new(homeserver).unwrap();
/// # let room_id = RoomId::try_from("!test:localhost").unwrap();
/// use matrix_sdk_common::uuid::Uuid;
///
/// let content = MessageEventContent::Text(TextMessageEventContent {
/// body: "Hello world".to_owned(),
/// formatted: None,
/// relates_to: None,
/// });
/// let content = MessageEventContent::Text(TextMessageEventContent::plain("Hello world"));
/// let txn_id = Uuid::new_v4();
/// client.room_send(&room_id, content, Some(txn_id)).await.unwrap();
/// # })

View File

@ -17,7 +17,7 @@ js_int = "0.1.8"
[dependencies.ruma]
git = "https://github.com/ruma/ruma"
features = ["client-api"]
rev = "9190bff1d03fb188aa1d24502129f9dd19a824e6"
rev = "ea2992a4120d34495d6f07f141350d8f2a3429d3"
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
uuid = { version = "0.8.1", features = ["v4"] }

View File

@ -1683,7 +1683,7 @@ mod test {
let plaintext = "It is a secret to everybody";
let content = MessageEventContent::Text(TextMessageEventContent::new_plain(plaintext));
let content = MessageEventContent::Text(TextMessageEventContent::plain(plaintext));
let encrypted_content = alice.encrypt(&room_id, content.clone()).await.unwrap();

View File

@ -37,10 +37,7 @@ pub use olm_rs::{
use matrix_sdk_common::{
events::{
room::{
encrypted::{EncryptedEventContent, MegolmV1AesSha2Content},
message::MessageEventContent,
},
room::{encrypted::EncryptedEventContent, message::MessageEventContent},
Algorithm, AnySyncRoomEvent, EventJson, EventType, SyncMessageEvent,
},
identifiers::{DeviceId, RoomId},
@ -332,14 +329,15 @@ impl OutboundGroupSession {
let ciphertext = self.encrypt_helper(plaintext).await;
EncryptedEventContent::MegolmV1AesSha2(MegolmV1AesSha2Content::new(
EncryptedEventContent::MegolmV1AesSha2(
matrix_sdk_common::events::room::encrypted::MegolmV1AesSha2ContentInit {
ciphertext,
sender_key: self.account_identity_keys.curve25519().to_owned(),
session_id: self.session_id().to_owned(),
device_id: (&*self.device_id).to_owned(),
},
))
}
.into(),
)
}
/// Check if the session has expired and if it should be rotated.