Skip to content

Commit 3733ee8

Browse files
committed
chore: Remove the matrix-sdk-crypto re-export in the matrix-sdk crate
1 parent d117532 commit 3733ee8

File tree

26 files changed

+64
-56
lines changed

26 files changed

+64
-56
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/matrix-sdk-ffi/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ matrix-sdk = { workspace = true, features = [
5454
"sqlite",
5555
"uniffi",
5656
] }
57+
matrix-sdk-base.workspace = true
5758
matrix-sdk-common.workspace = true
5859
matrix-sdk-ffi-macros.workspace = true
5960
matrix-sdk-ui = { workspace = true, features = ["uniffi"] }

bindings/matrix-sdk-ffi/src/client_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use std::{fs, num::NonZeroUsize, path::Path, sync::Arc, time::Duration};
33
#[cfg(not(target_family = "wasm"))]
44
use matrix_sdk::reqwest::Certificate;
55
use matrix_sdk::{
6-
crypto::{CollectStrategy, DecryptionSettings, TrustRequirement},
76
encryption::{BackupDownloadStrategy, EncryptionSettings},
87
event_cache::EventCacheError,
98
ruma::{ServerName, UserId},
@@ -14,6 +13,7 @@ use matrix_sdk::{
1413
Client as MatrixClient, ClientBuildError as MatrixClientBuildError, HttpError, IdParseError,
1514
RumaApiError, SqliteStoreConfig, ThreadingSupport,
1615
};
16+
use matrix_sdk_base::crypto::{CollectStrategy, DecryptionSettings, TrustRequirement};
1717
use ruma::api::error::{DeserializationError, FromHttpResponseError};
1818
use tracing::debug;
1919
use zeroize::Zeroizing;

bindings/matrix-sdk-ffi/src/identity_status_change.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
use matrix_sdk::crypto::IdentityState;
15+
use matrix_sdk_base::crypto::IdentityState;
1616

1717
#[derive(uniffi::Record)]
1818
pub struct IdentityStatusChange {

bindings/matrix-sdk-ffi/src/qr_code.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
use std::sync::Arc;
22

3-
use matrix_sdk::{
4-
authentication::oauth::{
5-
qrcode::{
6-
self, CheckCodeSender as SdkCheckCodeSender, CheckCodeSenderError,
7-
DeviceCodeErrorResponseType, GeneratedQrProgress, LoginFailureReason, QrProgress,
8-
},
9-
OAuth,
3+
use matrix_sdk::authentication::oauth::{
4+
qrcode::{
5+
self, CheckCodeSender as SdkCheckCodeSender, CheckCodeSenderError,
6+
DeviceCodeErrorResponseType, GeneratedQrProgress, LoginFailureReason, QrProgress,
107
},
11-
crypto::types::qr_login::{LoginQrCodeDecodeError, QrCodeModeData},
8+
OAuth,
129
};
1310
use matrix_sdk_common::{stream::StreamExt, SendOutsideWasm, SyncOutsideWasm};
1411

@@ -152,8 +149,8 @@ impl QrCodeData {
152149
/// will return `None`.
153150
pub fn server_name(&self) -> Option<String> {
154151
match &self.inner.mode_data {
155-
QrCodeModeData::Reciprocate { server_name } => Some(server_name.to_owned()),
156-
QrCodeModeData::Login => None,
152+
qrcode::QrCodeModeData::Reciprocate { server_name } => Some(server_name.to_owned()),
153+
qrcode::QrCodeModeData::Login => None,
157154
}
158155
}
159156
}
@@ -165,7 +162,7 @@ pub enum QrCodeDecodeError {
165162
#[error("Error decoding QR code: {error:?}")]
166163
Crypto {
167164
#[from]
168-
error: LoginQrCodeDecodeError,
165+
error: qrcode::LoginQrCodeDecodeError,
169166
},
170167
}
171168

bindings/matrix-sdk-ffi/src/room/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{collections::HashMap, fs, path::PathBuf, pin::pin, sync::Arc};
33
use anyhow::{Context, Result};
44
use futures_util::{pin_mut, StreamExt};
55
use matrix_sdk::{
6-
crypto::LocalTrust,
6+
encryption::LocalTrust,
77
room::{
88
edit::EditedContent, power_levels::RoomPowerLevelChanges, Room as SdkRoom, RoomMemberRole,
99
TryFromReportedContentScoreError,

bindings/matrix-sdk-ffi/src/timeline/msg_like.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
use std::{collections::HashMap, sync::Arc};
1616

17-
use matrix_sdk::crypto::types::events::UtdCause;
17+
use matrix_sdk_base::crypto::types::events::UtdCause;
1818
use ruma::events::{room::MediaSource as RumaMediaSource, MessageLikeEventContent};
1919

2020
use super::{

bindings/matrix-sdk-ffi/src/utd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
use std::{fmt::Debug, sync::Arc, time::Duration};
1616

17-
use matrix_sdk::crypto::types::events::UtdCause;
17+
use matrix_sdk_base::crypto::types::events::UtdCause;
1818
use matrix_sdk_common::{SendOutsideWasm, SyncOutsideWasm};
1919
use matrix_sdk_ui::unable_to_decrypt_hook::{
2020
UnableToDecryptHook, UnableToDecryptInfo as SdkUnableToDecryptInfo,

crates/matrix-sdk-ui/src/timeline/controller/decryption_retry_task.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ use imbl::Vector;
2323
use itertools::{Either, Itertools as _};
2424
use matrix_sdk::{
2525
Client, Room,
26-
crypto::store::types::RoomKeyInfo,
2726
deserialized_responses::TimelineEventKind as SdkTimelineEventKind,
2827
encryption::backups::BackupState,
2928
event_handler::EventHandlerHandle,
3029
executor::{JoinHandle, spawn},
3130
};
31+
use matrix_sdk_base::crypto::store::types::RoomKeyInfo;
3232
use tokio::sync::{
3333
RwLock,
3434
mpsc::{self, Receiver, Sender},
@@ -516,10 +516,8 @@ mod tests {
516516
use std::{collections::BTreeMap, sync::Arc, time::SystemTime};
517517

518518
use imbl::vector;
519-
use matrix_sdk::{
520-
crypto::types::events::UtdCause,
521-
deserialized_responses::{AlgorithmInfo, EncryptionInfo, VerificationState},
522-
};
519+
use matrix_sdk::deserialized_responses::{AlgorithmInfo, EncryptionInfo, VerificationState};
520+
use matrix_sdk_base::crypto::types::events::UtdCause;
523521
use ruma::{
524522
MilliSecondsSinceUnixEpoch, OwnedTransactionId,
525523
events::room::{

crates/matrix-sdk-ui/src/timeline/event_handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ use std::{borrow::Cow, sync::Arc};
1717
use as_variant::as_variant;
1818
use indexmap::IndexMap;
1919
use matrix_sdk::{
20-
crypto::types::events::UtdCause,
2120
deserialized_responses::{EncryptionInfo, UnableToDecryptInfo},
2221
send_queue::SendHandle,
2322
};
23+
use matrix_sdk_base::crypto::types::events::UtdCause;
2424
use ruma::{
2525
EventId, MilliSecondsSinceUnixEpoch, OwnedEventId, OwnedTransactionId, OwnedUserId,
2626
TransactionId,

0 commit comments

Comments
 (0)