Skip to content

Commit d039dad

Browse files
committed
feat(ffi): Add a method to check if the backup key is inside the secrets bundle
1 parent 66c79ac commit d039dad

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,15 @@ impl SecretsBundleWithUserId {
320320

321321
ret
322322
}
323+
324+
/// Does the bundle contain a backup key.
325+
///
326+
/// Since enabling a backup is optional, the backup key might be missing
327+
/// from the bundle. Returns `false` if the backup key is missing,
328+
/// otherwise `true`.
329+
pub fn contains_backup_key(&self) -> bool {
330+
self.inner.backup.is_some()
331+
}
323332
}
324333

325334
/// Check if a crypto store contains a valid [`SecretsBundle`].

0 commit comments

Comments
 (0)