Skip to content

Commit

Permalink
chore: update matrix-rust-sdk to 0.9.0 (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
Johennes authored Dec 20, 2024
1 parent 8c6257a commit 162f153
Show file tree
Hide file tree
Showing 7 changed files with 8,501 additions and 2,922 deletions.
4,243 changes: 3,038 additions & 1,205 deletions cpp/generated/matrix_sdk_ffi.cpp

Large diffs are not rendered by default.

393 changes: 292 additions & 101 deletions cpp/generated/matrix_sdk_ffi.hpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"scripts": {
"ubrn:android:build": "CARGO_TARGET_X86_64_LINUX_ANDROID_RUSTFLAGS=\"-L$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/lib/clang/17/lib/linux\" ubrn build android --config ubrn.yaml",
"ubrn:android:build:release": "yarn ubrn:android:build --release",
"ubrn:ios:build": "ubrn build ios --config ubrn.yaml",
"ubrn:ios:build": "CARGO_FEATURE_NO_NEON=1 ubrn build ios --config ubrn.yaml",
"ubrn:ios:build:release": "yarn ubrn:ios:build --release",
"ubrn:ios:generate": "ubrn generate all --config ubrn.yaml build/RnMatrixRustSdk.xcframework/ios-arm64/libmatrix_sdk_ffi.a && (cd example/ios && pod install)",
"ubrn:checkout": "ubrn checkout --config ubrn.yaml",
Expand Down
110 changes: 105 additions & 5 deletions src/generated/matrix_sdk_crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -905,13 +905,85 @@ export enum UtdCause {
/**
* We don't have an explanation for why this UTD happened - it is probably
* a bug, or a network split between the two homeservers.
*
* For example:
*
* - the keys for this event are missing, but a key storage backup exists
* and is working, so we should be able to find the keys in the backup.
*
* - the keys for this event are missing, and a key storage backup exists
* on the server, but that backup is not working on this client even
* though this device is verified.
*/
Unknown,
/**
* This event was sent when we were not a member of the room (or invited),
* so it is impossible to decrypt (without MSC3061).
* We are missing the keys for this event, and the event was sent when we
* were not a member of the room (or invited).
*/
Membership,
SentBeforeWeJoined,
/**
* The message was sent by a user identity we have not verified, but the
* user was previously verified.
*/
VerificationViolation,
/**
* The [`crate::TrustRequirement`] requires that the sending device be
* signed by its owner, and it was not.
*/
UnsignedDevice,
/**
* The [`crate::TrustRequirement`] requires that the sending device be
* signed by its owner, and we were unable to securely find the device.
*
* This could be because the device has since been deleted, because we
* haven't yet downloaded it from the server, or because the session
* data was obtained from an insecure source (imported from a file,
* obtained from a legacy (asymmetric) backup, unsafe key forward, etc.)
*/
UnknownDevice,
/**
* We are missing the keys for this event, but it is a "device-historical"
* message and there is no key storage backup on the server, presumably
* because the user has turned it off.
*
* Device-historical means that the message was sent before the current
* device existed (but the current user was probably a member of the room
* at the time the message was sent). Not to
* be confused with pre-join or pre-invite messages (see
* [`UtdCause::SentBeforeWeJoined`] for that).
*
* Expected message to user: "History is not available on this device".
*/
HistoricalMessageAndBackupIsDisabled,
/**
* The keys for this event are intentionally withheld.
*
* The sender has refused to share the key because our device does not meet
* the sender's security requirements.
*/
WithheldForUnverifiedOrInsecureDevice,
/**
* The keys for this event are missing, likely because the sender was
* unable to share them (e.g., failure to establish an Olm 1:1
* channel). Alternatively, the sender may have deliberately excluded
* this device by cherry-picking and blocking it, in which case, no action
* can be taken on our side.
*/
WithheldBySender,
/**
* We are missing the keys for this event, but it is a "device-historical"
* message, and even though a key storage backup does exist, we can't use
* it because our device is unverified.
*
* Device-historical means that the message was sent before the current
* device existed (but the current user was probably a member of the room
* at the time the message was sent). Not to
* be confused with pre-join or pre-invite messages (see
* [`UtdCause::SentBeforeWeJoined`] for that).
*
* Expected message to user: "You need to verify this device".
*/
HistoricalMessageAndDeviceIsUnverified,
}

const FfiConverterTypeUtdCause = (() => {
Expand All @@ -923,7 +995,21 @@ const FfiConverterTypeUtdCause = (() => {
case 1:
return UtdCause.Unknown;
case 2:
return UtdCause.Membership;
return UtdCause.SentBeforeWeJoined;
case 3:
return UtdCause.VerificationViolation;
case 4:
return UtdCause.UnsignedDevice;
case 5:
return UtdCause.UnknownDevice;
case 6:
return UtdCause.HistoricalMessageAndBackupIsDisabled;
case 7:
return UtdCause.WithheldForUnverifiedOrInsecureDevice;
case 8:
return UtdCause.WithheldBySender;
case 9:
return UtdCause.HistoricalMessageAndDeviceIsUnverified;
default:
throw new UniffiInternalError.UnexpectedEnumCase();
}
Expand All @@ -932,8 +1018,22 @@ const FfiConverterTypeUtdCause = (() => {
switch (value) {
case UtdCause.Unknown:
return ordinalConverter.write(1, into);
case UtdCause.Membership:
case UtdCause.SentBeforeWeJoined:
return ordinalConverter.write(2, into);
case UtdCause.VerificationViolation:
return ordinalConverter.write(3, into);
case UtdCause.UnsignedDevice:
return ordinalConverter.write(4, into);
case UtdCause.UnknownDevice:
return ordinalConverter.write(5, into);
case UtdCause.HistoricalMessageAndBackupIsDisabled:
return ordinalConverter.write(6, into);
case UtdCause.WithheldForUnverifiedOrInsecureDevice:
return ordinalConverter.write(7, into);
case UtdCause.WithheldBySender:
return ordinalConverter.write(8, into);
case UtdCause.HistoricalMessageAndDeviceIsUnverified:
return ordinalConverter.write(9, into);
}
}
allocationSize(value: TypeName): number {
Expand Down
Loading

0 comments on commit 162f153

Please sign in to comment.