From 90e39f7be22e16119fed731a6f5ce320ea019b65 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Wed, 28 Jun 2023 11:37:45 +0200 Subject: [PATCH] Revert "sdk: Re-export room_keys[_for_room]_received_stream from Encryption" This reverts commit 04d56130c32149aef92f2d7baffa9c01b3b32d9f. --- crates/matrix-sdk/src/encryption/mod.rs | 37 ++----------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/crates/matrix-sdk/src/encryption/mod.rs b/crates/matrix-sdk/src/encryption/mod.rs index 38f810017..13a3c0108 100644 --- a/crates/matrix-sdk/src/encryption/mod.rs +++ b/crates/matrix-sdk/src/encryption/mod.rs @@ -25,14 +25,11 @@ use std::{ }; use eyeball::shared::Observable as SharedObservable; -use futures_core::Stream; use futures_util::{ future::try_join, stream::{self, StreamExt}, }; -use matrix_sdk_base::crypto::{ - store::RoomKeyInfo, OlmMachine, OutgoingRequest, RoomMessageRequest, ToDeviceRequest, -}; +use matrix_sdk_base::crypto::{OlmMachine, OutgoingRequest, RoomMessageRequest, ToDeviceRequest}; use ruma::{ api::client::{ backup::add_backup_keys::v3::Response as KeysBackupResponse, @@ -53,7 +50,7 @@ use ruma::{ }, ImageInfo, MediaSource, ThumbnailInfo, }, - DeviceId, OwnedDeviceId, OwnedUserId, RoomId, TransactionId, UserId, + DeviceId, OwnedDeviceId, OwnedUserId, TransactionId, UserId, }; use tokio::sync::RwLockReadGuard; use tracing::{debug, instrument, trace, warn}; @@ -849,36 +846,6 @@ impl Encryption { Ok(olm.import_room_keys(import, false, |_, _| {}).await?) } - /// Receive notifications of room keys being received as a [`Stream`]. - /// - /// Each time a room key is updated in any way, an update will be sent to - /// the stream. Updates that happen at the same time are batched into a - /// [`Vec`]. - /// - /// If the reader of the stream lags too far behind, a warning will be - /// logged and items will be dropped. - pub async fn room_keys_received_stream(&self) -> Option>> { - Some(self.client.olm_machine().await.as_ref()?.store().room_keys_received_stream()) - } - - /// Receive notifications of a room keys for a specific room being received. - /// - /// Same as [`room_keys_received_stream`][Self::room_keys_received_stream], - /// but filtered by the given room ID. - pub async fn room_keys_for_room_received_stream( - &self, - room_id: &RoomId, - ) -> Option>> { - Some( - self.client - .olm_machine() - .await - .as_ref()? - .store() - .room_keys_for_room_received_stream(room_id), - ) - } - /// Enables the crypto-store cross-process lock. /// /// This may be required if there are multiple processes that may do writes