Commit Graph

73 Commits

Author SHA1 Message Date
Jonas Platte
f4e0cab11f feat(sdk)!: Merge HttpError::UiaaError into HttpError::Api 2022-10-12 12:34:09 +02:00
Damir Jelić
2f94886663 refactor(crypto)!: Don't use the Curve25519 sender key to store room keys 2022-10-10 15:20:25 +02:00
Jonas Platte
4fcbb61145 refactor!: Delete the store module
It was very confusing that matrix_sdk::store::make_store_config's first
argument was either a path or a database name depending on the build
configuration. ClientBuilder::{sled_store, indexeddb_store} are also
easier to use.
2022-10-05 13:49:12 +02:00
Jonas Platte
ab1a6a6b37 chore: Remove experimental-timeline Cargo feature 2022-09-30 13:48:17 +02:00
Benjamin Kampmann
f1f1c1bba6 chore: Version bump 2022-09-28 17:07:37 +02:00
Benjamin Kampmann
e8278b5d68 feat: add Result return value to sync_* (#1037)
Inspired by the changes in #1013 I was thinking about the use case for `sync_*` and how we handle error cases. Most notably while we give the callback the option to stop the loop, we don't really give an indication to the outside, how to interpret that cancellation: was there a failure? should we restart?

Take e.g. a connectivity issue on the wire, we'd constantly loop and just `warn`, what you might or might not see. Even if you handle that in the `sync_with_result_callback` and thus break the loop, the outer caller now still doesn't know whether everything is honky dory or whether they should restart. 

This Changes reworks that area by having all the `sync` return `Result<(), Error>`, where `()` means it was ended by the inner callback (which in `sync()` never occurs) or `Error` is the error either the inner `result_callback` found or the that was coming from the `send` in the first place. Thus allowing us to e.g. back down to sync as it was a dead wire or restart it if there was only a temporary problem. Making all that a just a bit more "rust-y".
2022-09-26 17:14:15 +02:00
Jonas Platte
92809590b1 Revert "feat(examples): Add an example that lets you create rooms"
This reverts commit 01f8ed10aa.
2022-09-26 12:23:08 +02:00
Johannes Becker
c23976f975 refactor(appservice): Move example to top-level 2022-09-23 17:01:01 +02:00
Jonas Platte
b12da9d4db refactor!: Move JS-specific functionality behind a Cargo feature
… for matrix-sdk, matrix-sdk-base, matrix-sdk-common and matrix-sdk-crypto.
matrix-sdk-indexeddb as well as the JS bindings and wasm_command_bot are
left as-is because they will likely always require JS.
2022-09-20 14:08:21 +02:00
Jonas Platte
8da456055d refactor: Use event handlers in emoji_verification example 2022-09-15 18:33:58 +02:00
Damir Jelić
321e56cff8 fix(examples): Listen to the done event in the emoji verification example
Nowadays all verifications send a done event, so this is the safer
option.
2022-09-05 15:54:45 +02:00
Damir Jelić
a640312503 feat(crypto): Add method to format emojis
This patch adds a method to format a list of emojis in a a terminal
friendly way.

This method was borrowed from weechat-matrix but it's also quite useful
in our own emoji verification example.
2022-09-05 15:54:45 +02:00
Damir Jelić
b2452ae92c feat(examples): Add a verbosity flag to the emoji example
Since this example prints out messages to stdout, it becomes quite hard
to see when we ask for user input if all the logging is going on.

This patch adds a standard verbosity flag which disables all logging by
default.
2022-09-05 15:54:45 +02:00
Damir Jelić
faf0ce5007 chore(examples): Remove some empty useless attributes 2022-09-02 14:54:33 +02:00
Damir Jelić
c5e6178b70 refactor(examples): Add proxy support to the emoji verification example 2022-09-02 14:54:33 +02:00
Benjamin Kampmann
0079f1d569 Merge pull request #977 from zecakeh/fix-examples-autojoin
fix(examples): Fix examples that accept invites
2022-09-02 11:14:40 +02:00
Jonas Platte
e4267cc4fd refactor(sdk)! Make upload take &[u8] instead of impl Read
The use of `io::Read` wasn't helping since we had to buffer the whole
file in memory anyways, and we are unlikely to get around that in the
near future.
2022-09-01 13:40:47 +02:00
Ivan Enderlin
193da88320 feat(crypto): Rename verified and deleted to is_*
feat(crypto): Rename `verified` and `deleted` to `is_*`
2022-09-01 10:50:05 +02:00
Damir Jelić
16d9ed230a chore(examples): Use automatic links for some URLs 2022-08-31 18:43:47 +02:00
Ivan Enderlin
2e74983c79 chore: Fix other is_verified. 2022-08-31 17:16:05 +02:00
Damir Jelić
01f8ed10aa feat(examples): Add an example that lets you create rooms 2022-08-31 11:51:50 +02:00
Kévin Commaille
dc39c8d96b fix(examples): Fix examples that accept invites
Spawn a task for accepting the invite otherwise the call never returns and sync stops.
2022-08-26 18:15:56 +02:00
Jonas Platte
4be2f3aa04 chore: Upgrade ruma 2022-08-25 18:09:13 +02:00
Jonas Platte
0b8462423a chore: Reduce indirect dependencies of examples 2022-08-23 18:30:44 +02:00
Chris Guida
2beb13cc3e update instructions for wasm_command_bot example 2022-08-15 17:56:54 -05:00
Damir Jelić
06e096f6cc fix(examples): Fix the in-room emoji verification example 2022-08-09 14:04:11 +02:00
Jonas Platte
3b03ad804f refactor(sdk)!: Swap the async lock around event handlers for a sync one 2022-08-05 16:16:41 +02:00
Jonas Platte
dfec17e6af chore: Disable testing of crates without tests
This reduces the amount of "running 0 tests" spam when testing the whole
workspace and makes testing a little faster overall.
2022-08-05 11:10:31 +02:00
Benjamin Kampmann
c4c7c2bb23 docs: remove unused import and fix style of custom events example 2022-08-04 15:02:39 +02:00
Benjamin Kampmann
efc0556124 doc: follow naming convention and use generated types from ruma 2022-08-04 13:31:16 +02:00
Benjamin Kampmann
9d588f7e00 doc: add example for sending and reacting on custom events 2022-08-04 13:13:48 +02:00
Benjamin Kampmann
fe4bc0dc75 doc: fix docs of getting started bot 2022-08-03 17:07:59 +02:00
Benjamin Kampmann
ccbd9e5712 chore: rename Readme.md to README.md 2022-08-03 16:39:14 +02:00
Benjamin Kampmann
9538596fbb doc: Add getting-started example autojoin & command bot with plenty of source docs 2022-08-03 13:05:25 +02:00
Benjamin Kampmann
35be128139 docs: add Readme to examples root 2022-08-03 12:06:50 +02:00
Benjamin Kampmann
4c7ddd7512 refactor: move examples from crates/matrix-sdk into separate crates in examples/ 2022-08-02 15:06:04 +02:00
Damir Jelić
5fef444d61 matrix-sdk: Split out the crypto part of the sdk into a separate crate. 2020-04-29 09:48:00 +02:00
Damir Jelić
1de791c207 rust-sdk: Update to the latest ruma releases. 2020-04-23 10:52:47 +02:00
Devin R
9b52b58fea command_bot: pass sync_token to sync_forever 2020-04-15 09:54:53 -04:00
Devin R
63368a9437 command_bot: remove timestamp 2020-04-15 08:44:29 -04:00
Devin R
c495a50c52 async_client: make pub API take &self instead of &mut, use read where possible 2020-04-15 08:29:34 -04:00
Devin R
3f9243a326 command-bot: add comments, use timestamp to filter old messages 2020-04-15 07:52:29 -04:00
Devin R
49e962e9c4 event_emitter: use Arc<RwLock<Room for EventEmitter and joined_rooms HashMap 2020-04-15 06:58:25 -04:00
Devin R
6d1cbcd9ca remove runtime and clean up example 2020-04-14 18:14:14 -04:00
Devin R
cf029b2e4f make EventEmitter shared refs, in AsyncClient::sync lock only in inner most scope 2020-04-14 18:10:10 -04:00
Devin R
a5ab7d97da use AsyncClient::sync_forever 2020-04-14 15:16:20 -04:00
Devin R
87c9dbdad7 clone client 2020-04-14 14:49:29 -04:00
Devin R
6f2b5194d1 remove unused imports/vars 2020-04-14 08:45:40 -04:00
Devin R
5f2269f12f party bot example responds to !party 2020-04-14 08:39:51 -04:00
Devin R
c2b3210cc9 cargo fmt/clippy, move power levels into Room 2020-04-05 12:41:00 -04:00