Commit Graph

6011 Commits

Author SHA1 Message Date
Benjamin Bouvier
b4c192509b chore: remove unused FFI add_common_extensions
Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-05-25 11:26:32 +02:00
Damir Jelić
5e3a114830 Log the message id when we share a room key 2023-05-24 12:29:15 +02:00
Damir Jelić
2e09bf63a6 Add a message id to our encrypted to-device events 2023-05-24 12:29:15 +02:00
Damir Jelić
19ca9478b7 Clean up some room key forwarding logs 2023-05-24 12:29:15 +02:00
Ivan Enderlin
17f4ba5c9b fix(sdk): Client::sliding_sync doesn't need to be async
fix(sdk): `Client::sliding_sync` doesn't need to be `async`
2023-05-24 12:26:33 +02:00
Ivan Enderlin
a2a1b35622 fix(sdk): Client::sliding_sync doesn't need to be async.
The `Client::sliding_sync` method was declared as async. However, it's
not necessary as everything happening here is sync.
2023-05-24 11:56:38 +02:00
Ivan Enderlin
b60a317174 feat(sdk): Implement SlidingSync::stop_sync
feat(sdk): Implement `SlidingSync::stop_sync`
2023-05-24 11:52:19 +02:00
Jonas Platte
ac106c7059 bindings: Use native async for SessionVerificationController 2023-05-24 11:31:33 +02:00
Jonas Platte
2660e7bcf1 bindings: Use native async support for latest_room_message 2023-05-24 11:31:33 +02:00
Jonas Platte
ffc8453c63 bindings: Use async-compat tokio runtime 2023-05-24 11:31:33 +02:00
Jonas Platte
587c5b05b1 Upgrade UniFFI 2023-05-24 11:31:33 +02:00
Ivan Enderlin
728cd5db86 fix(sdk): Restore the size of the SS channel.
Because it doesn't solve any problem, it just postpones it, making the
whole thing more difficult to debug.
2023-05-24 11:02:06 +02:00
Ivan Enderlin
512a5e77cd feat(sdk): Log when messages are sent internally by SlidingSync. 2023-05-24 11:01:42 +02:00
Ivan Enderlin
e9bbf366ba chore(sdk): Simplify code. 2023-05-24 09:19:12 +02:00
Ivan Enderlin
849f83adb7 chore(sdk): Remove an allow(unused). 2023-05-24 09:06:32 +02:00
Ivan Enderlin
415778d44d feat(ffi): Implement SlidingSync::stop_sync. 2023-05-24 09:03:03 +02:00
Ivan Enderlin
47922f7f50 test(sdk): Test SlidingSync::stop_sync_loop. 2023-05-24 08:59:28 +02:00
Ivan Enderlin
7bde2cfd4a feat(sdk): Add log in SlidingSync when an internal message is received. 2023-05-24 08:44:51 +02:00
Ivan Enderlin
99bbf2a42b feat(sdk): Implement SlidingSync::stop_sync.
In case it's not obvious to drop the `Stream` returned by
`SlidingSync::sync` immediately to “stop” the sync-loop, one can use the
new `stop_sync` method to do achieve the same result.
2023-05-24 08:42:12 +02:00
Ivan Enderlin
b8580b76f7 feat(sdk): Rename SlidingSync::stream to ::sync.
Because it doesn't start a stream, but a sync-loop.
2023-05-24 08:20:29 +02:00
Damir Jelić
c042e1e63c Disable automatic-key-forwarding for the matrix-sdk-ffi bindings
Not completely sure why disabling this didn't work the first time. The
feature is now disabled by default in the matrix-sdk-crypto crate.
2023-05-23 16:42:34 +02:00
Damir Jelić
3db90fbe02 Use the new VerificationRequest signalling in the emoji example 2023-05-23 16:10:05 +02:00
Damir Jelić
b07718b5d5 Expose the VerificationRequest signalling and states in the main crate 2023-05-23 16:10:05 +02:00
Damir Jelić
e9c3aa1a2e Add a state for the VerificationRequest for when a request transitions
The `VerificationRequest` object is used to control the flow of the
verification but only up to a certain point.

Once we start handling of different specific verification flows (i.e.
SAS or QR code verification) the `VerificationRequest` object creates a
child object of the Verification type.

This patch adds a new `VerificationRequestState` variant called
`Transitioned` which holds the child verification object as associated
data.

This makes it much simpler to go through the whole verification flow by
allowing users to just listen to the `VerificationRequest::changes()`
method.
2023-05-23 16:10:05 +02:00
Florian Renaud
2cce236f4d feat(bindings): exposed set_name in Room 2023-05-22 17:58:14 +02:00
Jonas Platte
2f243bce55 Stop unconditionally enabling native-tls from matrix-sdk-ffi 2023-05-22 16:26:40 +02:00
Ivan Enderlin
d27754cb61 Replace the libolm backup encryption code with a native Rust version
Replace the libolm backup encryption code with a native Rust version
2023-05-22 14:56:21 +02:00
Ivan Enderlin
cc10f995ff feat(sdk): Implement SlidingSyncList::set_sync_mode
feat(sdk): Implement `SlidingSyncList::set_sync_mode`
2023-05-22 14:38:01 +02:00
Benjamin Bouvier
befb5dbdb8 chore: add log when exiting the sync loop's stream
Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-05-22 14:13:13 +02:00
Benjamin Bouvier
5c785be7dd fix(sdk): increase the internal channel receiver size up from 8 to 256
We suspect that there might be too many internal messages being pushed, causing a deadlock on the senders' side.
This attempts to increase the value of the buffer to give it more leeway.

Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-05-22 14:13:13 +02:00
Ivan Enderlin
322f5495ac fix(sdk): SlidingSyncListInner::timeline_limit and ranges are no longer observable
fix(sdk): `SlidingSyncListInner::timeline_limit` and `ranges` are no longer observable
2023-05-22 12:05:45 +02:00
Ivan Enderlin
4eee60dc9e chore(sdk): Make Clippy happy. 2023-05-22 11:32:54 +02:00
Ivan Enderlin
abf8a50c0d chore(sdk): Make Clippy happy. 2023-05-22 11:24:11 +02:00
Ivan Enderlin
e9399eb635 doc(sdk): Do no link to a private function. 2023-05-22 10:54:36 +02:00
Ivan Enderlin
4e00d04611 fix(sdk): SlidingSyncListInner::timeline_limit and ranges are no longer observable.
The `SlidingSyncListInner::timeline_limit` and `::ranges` fields were
observable (behind `eyeball::Observable`). It was actually useless
as those fields were never exposed to the public API, thus it was
impossible to subscribe to them.

This patch cleans up that. `timeline_limit` and `ranges` are no longer
observable.
2023-05-22 10:50:26 +02:00
Ivan Enderlin
fee1a50f38 doc(sdk): Improve documentation of next_request. 2023-05-22 09:39:43 +02:00
Ivan Enderlin
6e77804070 feat(sdk): SlidingSyncList::set_sync_mode sends an internal message.
This patch updates `SlidingSyncList::set_sync_mode` to send a
`SyncLoopSkipOverCurrentIteration` internal message to the sync loop.
2023-05-22 09:38:42 +02:00
Ivan Enderlin
82f5768df3 feat(sdk): Rename SlidingSyncInternalMessage variants.
This patch renames the variant to be more explicit about what they do
instead of re-using the “for loop vocabulary”.
2023-05-22 09:37:32 +02:00
Ivan Enderlin
4ee2f2a44b chore(sdk): Run rustfmt. 2023-05-22 08:43:10 +02:00
Ivan Enderlin
f37945da13 chore(comment): fix the comment for Error::CannotModifyRanges
chore(comment): fix the comment for `Error::CannotModifyRanges`
2023-05-20 18:05:13 +02:00
Ivan Enderlin
88ebd89937 doc(sdk): Fix a typo.
Co-authored-by: Benjamin Bouvier <public@benj.me>
2023-05-20 17:57:21 +02:00
Ivan Enderlin
2f29664fb8 doc(sdk): Fix a typo.
Co-authored-by: Benjamin Bouvier <public@benj.me>
2023-05-20 17:57:11 +02:00
Benjamin Bouvier
da73229e8d chore(comment): fix the comment for Error::CannotModifyRanges
The comment and the check in the code were contradicting each other; the comment was wrong, and the code was right, so there's that.

Signed-off-by: Benjamin Bouvier <public@benj.me>
2023-05-19 16:03:59 +02:00
Damir Jelić
34aed2f939 Replace the libolm backup encryption code with a native Rust version
This patch removes our dependency to libolm completely. This should
allow WASM targets to use the backups_v1 feature of the
matrix-sdk-crypto crate as well.
2023-05-18 10:52:51 +02:00
Ivan Enderlin
ff1d784e70 fix(ci): Fix path to matrix-sdk-crypto-js and allow pushd to return an error
fix(ci): Fix path to `matrix-sdk-crypto-js` and allow `pushd` to return an error
2023-05-17 20:18:03 +02:00
Ivan Enderlin
9912a4a6db doc(sdk): Fix a typo. 2023-05-17 20:16:01 +02:00
Ivan Enderlin
7b0336bb29 doc(sdk): Fix a typo. 2023-05-17 20:07:12 +02:00
Ivan Enderlin
d86647db77 chore(ci): Give pushd's result a name so that it's not dropped. 2023-05-17 20:00:33 +02:00
Jonas Platte
d13d41951f Silence clippy warning from macro-generated code 2023-05-17 17:20:55 +02:00
Jonas Platte
f68fd6c7cf Use workspace dependencies for futures-core 2023-05-17 17:20:55 +02:00