Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions crates/matrix-sdk/src/encryption/recovery/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,3 @@ pub(super) struct SecretStorageDisabledContent {}
pub(super) struct KeyBackupContent {
pub enabled: bool,
}

/// Unstable prefix form of [MSC4287].
///
/// [MSC4287]: https://github.com/matrix-org/matrix-spec-proposals/pull/4287
#[derive(Clone, Debug, Default, Deserialize, Serialize, EventContent)]
#[ruma_event(type = "m.org.matrix.custom.backup_disabled", kind = GlobalAccountData)]
pub(super) struct BackupDisabledContent {
pub disabled: bool,
}
75 changes: 0 additions & 75 deletions crates/matrix-sdk/tests/integration/encryption/recovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,26 +248,6 @@ async fn enable(

let backup_disabled_content = Arc::new(Mutex::new(None));

let _quard = Mock::given(method("PUT"))
.and(path(format!(
"_matrix/client/r0/user/{user_id}/account_data/m.org.matrix.custom.backup_disabled"
)))
.and(header("authorization", "Bearer 1234"))
.and({
let backup_disabled_content = backup_disabled_content.clone();
move |request: &wiremock::Request| {
let content: Value = request.body_json().expect("The body should be a JSON body");

*backup_disabled_content.lock().unwrap() = Some(content);

true
}
})
.respond_with(ResponseTemplate::new(200).set_body_json(json!({})))
.expect(1)
.mount_as_scoped(server)
.await;

let _guard = Mock::given(method("GET"))
.and(path("_matrix/client/r0/room_keys/version"))
.and(header("authorization", "Bearer 1234"))
Expand Down Expand Up @@ -533,28 +513,6 @@ async fn test_backups_enabling() {
.mount(&server)
.await;

Mock::given(method("PUT"))
.and(path(format!(
"_matrix/client/r0/user/{user_id}/account_data/m.org.matrix.custom.backup_disabled"
)))
.and(header("authorization", "Bearer 1234"))
.and(|request: &wiremock::Request| {
#[derive(Deserialize)]
struct Disabled {
disabled: bool,
}

let content: Disabled = request.body_json().expect("The body should be a JSON body");

assert!(!content.disabled, "The backup support should be marked as enabled.");

true
})
.respond_with(ResponseTemplate::new(200).set_body_json(json!({})))
.expect(1)
.mount(&server)
.await;

Mock::given(method("POST"))
.and(path("_matrix/client/unstable/room_keys/version"))
.and(header("authorization", "Bearer 1234"))
Expand Down Expand Up @@ -672,28 +630,6 @@ async fn test_recovery_disabling() {
.mount(&server)
.await;

Mock::given(method("PUT"))
.and(path(format!(
"_matrix/client/r0/user/{user_id}/account_data/m.org.matrix.custom.backup_disabled"
)))
.and(header("authorization", "Bearer 1234"))
.and(|request: &wiremock::Request| {
#[derive(Deserialize)]
struct Disabled {
disabled: bool,
}

let content: Disabled = request.body_json().expect("The body should be a JSON body");

assert!(content.disabled, "The backup support should be marked as disabled.");

true
})
.respond_with(ResponseTemplate::new(200).set_body_json(json!({})))
.expect(1)
.mount(&server)
.await;

Mock::given(method("GET"))
.and(path(format!(
"_matrix/client/r0/user/{user_id}/account_data/m.secret_storage.default_key"
Expand Down Expand Up @@ -976,17 +912,6 @@ async fn test_reset_identity() {
.mount(&server)
.await;

Mock::given(method("PUT"))
.and(path(format!(
"_matrix/client/r0/user/{user_id}/account_data/m.org.matrix.custom.backup_disabled"
)))
.and(header("authorization", "Bearer 1234"))
.respond_with(ResponseTemplate::new(200).set_body_json(json!({})))
.expect(1)
.named("m.org.matrix.custom.backup_disabled PUT")
.mount(&server)
.await;

Mock::given(method("GET"))
.and(path(format!("_matrix/client/r0/user/{user_id}/account_data/m.key_backup")))
.and(header("authorization", "Bearer 1234"))
Expand Down
Loading