Commit Graph

7473 Commits

Author SHA1 Message Date
Jonas Platte 541c0ef559 widget: Add an integration test for immediate capability negotiation 2023-10-18 12:34:34 +02:00
Jonas Platte 65cc926612 widget: Add more tracing events 2023-10-18 12:34:34 +02:00
Jonas Platte c550fa80a7 widget: Coalesce matrix driver response messages into an enum 2023-10-18 12:34:34 +02:00
Jonas Platte 5113d6e161 widget: Don't alias ruma request type 2023-10-18 12:34:34 +02:00
Jonas Platte f910d10f6b widget: Rename Event -> IncomingMessage 2023-10-18 12:34:34 +02:00
Jonas Platte 29620144fe widget: Split up Machine::process and add more sanity checks 2023-10-18 12:34:34 +02:00
Daniel Abramov deff0a06f5 widget: Implement capability negotiation 2023-10-18 12:34:34 +02:00
Jonas Platte e038ced2c6 widget: Add toWidget & MatrixDriver response handling skeleton 2023-10-18 12:34:34 +02:00
Richard van der Hoff f75b2cd1d0 Documentation on /keys/query parsing functions (#2674)
These functions are a bit confusing, so I wrote some comments. I also factored out
`get_user_signing_key_from_response`, to reduce duplication and (IMHO) improve clarity.
2023-10-17 16:55:26 +01:00
Jonas Platte 7c4046e463 widget: Implement requesting of capabilities w/o init_on_content_load 2023-10-17 16:55:02 +02:00
Jonas Platte a4cc28f94a widget: Rename client module to machine 2023-10-17 16:55:02 +02:00
Jonas Platte de0543c2e2 widget: Rename settings#id to widget_id 2023-10-17 16:55:02 +02:00
Jonas Platte 4a1e4cd279 widget: Rename ClientApi to WidgetMachine 2023-10-17 16:55:02 +02:00
Jonas Platte a812f17ec4 widget: Clarify MatrixDriver's purpose 2023-10-17 16:55:02 +02:00
Jonas Platte 7c958498bf ui: Raise log level for prev_batch wait timeout
… since it can cause rather annoying problems with the SS proxy
if it happens.
2023-10-17 11:02:15 +02:00
Jonas Platte 06e3fc4235 widget: Add a failing (ignored) test for reading room messages 2023-10-17 10:54:51 +02:00
Jonas Platte 07951b88d3 widget: Separate reading of message and state events
… and use the state store for the latter.

Co-authored-by: Timo K <timok@element.io>
2023-10-17 10:54:51 +02:00
Jonas Platte 5775a6e628 widget: Group trait impls in client::outgoing 2023-10-17 10:54:51 +02:00
Jonas Platte 20021abee3 widget: Fix clippy warning 2023-10-17 10:54:51 +02:00
Jonas Platte b3f37459b7 widget: Reduce visibility on widget::matrix types and their methods 2023-10-17 10:54:51 +02:00
Jonas Platte 8496673310 sdk: Move WidgetSettings constructor to top of impl block 2023-10-17 10:54:51 +02:00
Richard van der Hoff 3c9f48dcb5 common: Add a tracing MakeWriter for writing to a JS Logger
Replace the old `tracing_subscriber::layer::Layer` with a `MakeWriter` which
can then be plugged into a `fmt::Subscriber`.
2023-10-16 20:10:41 +02:00
Jonas Platte 7f3fef5d8b ci: Run documentation CI workflow when un-drafting a PR 2023-10-16 15:44:20 +02:00
Timo 7ee872c4bd Fix avatar url and display name in element call link generation
Signed-off-by: Timo K <toger5@hotmail.de>
Co-authored-by: Jonas Platte <jplatte@matrix.org>
2023-10-16 11:00:32 +02:00
Richard van der Hoff a433d51efc Add static lifetimes to some constants
My compiler is complaining about lack of explicit lifetimes on these consts
2023-10-13 13:59:56 +02:00
Benjamin Bouvier 41a26e30e9 oidc: use sha2 to hash everything oidc-related
Hashes computed by `compute_session_hash` may be stored in the crypto store, and may or may not
be encrypted; make them slightly more secure by using a more secure hash. Also use sha2 for
the logged hashes that are useful for debugging OIDC issues.
2023-10-13 11:06:08 +02:00
Benjamin Bouvier efb16ed5b4 oidc: remove logging of hashed token
This was useful during development of the OIDC feature, but now that it's rather stable,
let's remove it from the traces.
2023-10-13 11:06:08 +02:00
Jonas Platte 735b0d2d24 ffi: Allow MessageType to contain arbitrary msgtype values, plus body
… allows the FFI type MessageLikeEventContent to hold custom msgtypes,
which is useful for notification.
Also allows sending custom msgtypes, as long as no fields other than the
msgtype itself and body are needed.
2023-10-13 10:06:07 +02:00
Jonas Platte 51ee8209bd sdk: Use BTreeSet instead of HashSet in widget tests
… for deterministic / comparable debug formatting.
2023-10-12 18:39:47 +02:00
Jonas Platte bc0e3609d0 sdk: Rewrap strings in widget tests 2023-10-12 18:39:47 +02:00
Jonas Platte a6a4695dd4 ffi: Inline local variables in WidgetSettings conversion 2023-10-12 18:39:47 +02:00
Alfonso Grillo f826999773 feature: send voice message API (#2697)
This PR adds a ffi binding for sending voice messages in the legacy format (before extensible events). It also makes minor changes in the `matrix-sdk` crate to accomodate this change.

* Add send_voice_message api

* Update ruma-events dependency

* Fix attachment info mapping

* Remove unstable dependency in attachment.rs

* Bump ruma-events

* Fix matrix-sdk Cargo.toml

* Fix formatting issues

* Refactor Voice case

* Remove clone from AttachmentInfo

* Remove duplicate code

* Remove unused imports

* Fix formatting issue

* Rename update function
2023-10-12 16:34:09 +00:00
Jonas Platte ba2a5137dc ui: Fix missing thread relation when sending reply to threaded message 2023-10-12 16:02:34 +02:00
Alfonso Grillo eadc7b9052 feat: enable push rules when changing actions (#2708) 2023-10-12 14:41:12 +02:00
Daniel Abramov b98c4772e5 widget: Define outgoing request types
This includes the requests that are sent to the matrix client (i.e.
a request to send a matrix event) as well as requests that are sent to
the widget.

The difference between this and `Action` is that `Action` is rather
"low-level" (i.e. it has a generic `SendToWidget(String)` variant),
whereas this API is a high-level API that we will use internally to
conveniently issue and `await` for outgoing responses.
2023-10-12 12:20:13 +02:00
Kévin Commaille 10393eee8d ui: Require PaginationOptions strategy to be Sync
Otherwise PaginationOption is not Send.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-10-12 09:44:40 +00:00
Jonas Platte 4e86954008 Upgrade async-compat 2023-10-11 15:21:18 +02:00
Jonas Platte 4b98d24230 Upgrade UniFFI 2023-10-11 15:21:18 +02:00
Jonas Platte d54668305e ci: Run widget tests in coverage job
… the other experimental features were already getting enabled through
matrix-sdk-ui, so don't need to be enabled explicitly.
2023-10-11 15:13:08 +02:00
Daniel Abramov 9cea46c459 widget: add unit tests for Permissions 2023-10-11 15:13:08 +02:00
Daniel Abramov f0521f72d5 widget: add serialize/deserialize for permissions
Co-authored-by: Jonas Platte <jplatte@matrix.org>
2023-10-11 15:13:08 +02:00
Benjamin Bouvier 77cb1b7f11 oidc: add cross-process lock test 2023-10-11 14:58:52 +02:00
Jonas Platte b8185c0c67 ui: Fix hidden lifetime warnings 2023-10-11 14:42:24 +02:00
Benjamin Bouvier 97844ea8af oidc: remove dead code 2023-10-11 14:18:55 +02:00
Benjamin Bouvier 51b6ecc0b8 oidc: add test for getters 2023-10-11 14:18:55 +02:00
Benjamin Bouvier 2ad567883c oidc: add test for session_token_stream 2023-10-11 14:18:55 +02:00
Benjamin Bouvier f74f2eda76 oidc: remove dead code
This code path could never be taken:

- the only way to set the cross_process_token_refresh_manager is from calling the same function
- this function is guarded against a lock, so it's not reentrant
- this function's only internally called, during `restore_session` or after a successful login:
both will set a session, hence those functions would fail beforehands if another session had
been set earlier.
2023-10-11 14:18:55 +02:00
Benjamin Bouvier 9e8c6e639b oidc: add comments and tarpaulin annotations 2023-10-11 14:18:55 +02:00
Kévin Commaille b14ac1f2b9 Add test for event visibility change
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-10-11 12:00:09 +02:00
Kévin Commaille 818a1ba992 Log inconsistent state
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-10-11 12:00:09 +02:00