Commit graph

496 commits

Author SHA1 Message Date
Damir Jelić
924405270a fix(sdk): Use the markdown feature flag of ruma dirrectly 2021-09-09 20:57:58 +02:00
Damir Jelić
ed198a22b6 Merge branch 'custom-store' 2021-09-09 12:24:27 +02:00
Damir Jelić
13b97f6dba fix(base): Remove an unnecessary unwrap from a test 2021-09-09 12:24:15 +02:00
Damir Jelić
b09b667782 fix(base): Flush when we're saving custom stuff in the sled store 2021-09-09 11:55:05 +02:00
Damir Jelić
5ff69ad1a9 fix(base): Mark rooms as DMs when we receive an m.direct event 2021-09-09 10:21:05 +02:00
Amanda Graven
5be7bb980d
Add custom storage
Add an additional tree to the Store where custom api consumer data may
be stored.
2021-08-25 11:39:43 +02:00
Jonas Platte
d348e77468
Remove extraneous space 2021-08-17 00:32:24 +02:00
Jonas Platte
a5ff4fbef7
Simplify struct initializations by using Default::default 2021-08-17 00:32:23 +02:00
Jonas Platte
36ceb66ba5
Remove prev_content compat hacks
This is now handled by Ruma.
2021-08-17 00:26:01 +02:00
Jonas Platte
578ddd2698
Upgrade to ruma 0.3.0 2021-08-12 10:41:20 +02:00
Damir Jelić
aa5f532f86 Merge branch 'master' into room-state-getters 2021-07-27 11:18:29 +02:00
Damir Jelić
3d734a120d Merge branch 'hoist-deserialize-fix' 2021-07-26 16:16:08 +02:00
Damir Jelić
05eeba067c base: Add docs to the newly public hoist and deserialize method 2021-07-26 15:58:18 +02:00
Damir Jelić
ead91a1e6b crypto: Send cancellations if the other device picks up over to-device 2021-07-12 18:12:02 +02:00
Sorunome
27ad1f42da
use hoist_and_deserialize for state events 2021-07-04 08:42:59 +02:00
Jonas Platte
4d5768111d
Simplify ruma identifier imports 2021-06-23 16:12:23 +02:00
Damir Jelić
b95ebe444e matrix-sdk: Bump our versions 2021-06-22 14:57:46 +02:00
Damir Jelić
57b2f6ad22 matrix-sdk: Switch to a release of ruma 2021-06-21 19:53:26 +02:00
Damir Jelić
17097f4d42 matrix-sdk: Upgrade our deps 2021-06-21 16:45:52 +02:00
Jonas Platte
43e213fd67 matrix-sdk: Update ruma
Co-authored-by: Damir Jelić <poljar@termina.org.uk>
2021-06-21 15:45:33 +02:00
Fisher Darling
4cc7237db3 remove getting every state event and add getters to room 2021-06-17 23:34:26 -06:00
Damir Jelić
0fb3dedd1c client: Fix compilation when the encryption feature is disabled 2021-06-17 12:35:37 +02:00
Damir Jelić
3cf843d24f matrix-sdk: Rework the public API for answering verifications 2021-06-17 12:17:11 +02:00
Damir Jelić
ada71586ac crypto: Scope the verifications per sender 2021-06-17 11:04:17 +02:00
Fisher Darling
cb6269d5ec add more state event getters to store 2021-06-14 20:59:53 -06:00
Jonas Platte
c964589049
base: Depend on ruma directly 2021-06-07 18:55:56 +02:00
Jonas Platte
3bac536daf
Fix clippy lints
Automated via `cargo clippy --workspace --all-targets -Zunstable-options --fix`.
2021-06-07 15:51:18 +02:00
Damir Jelić
6f11244017 Merge branch 'typos' 2021-06-06 21:01:30 +02:00
Jonas Platte
6b685b671d
Replace Arc<Box<dyn (Crypto|State)Store>> by Arc<dyn (Crypto|State)Store> 2021-06-06 18:16:25 +02:00
Jonathan de Jong
74a6d39b9f various typos 2021-06-05 14:35:20 +02:00
Damir Jelić
d58a190712 Merge branch 'media-store' 2021-05-31 10:36:20 +02:00
Damir Jelić
10b38ce44e matrix-sdk: Fix a bunch of typos 2021-05-31 09:35:19 +02:00
Kévin Commaille
5e05b37d02
base: Add tests for media content storage 2021-05-25 22:10:04 +02:00
Kévin Commaille
df883d3328
Add MediaEventContent trait and implement it for corresponding room events
Add helper methods in Client
2021-05-25 21:52:27 +02:00
Kévin Commaille
c318a6e847
base: Add media store 2021-05-25 21:16:28 +02:00
Damir Jelić
bdd51a323a Merge branch 'read-receipts' 2021-05-25 19:25:48 +02:00
Kévin Commaille
f619bbb884
base: Change receipt store tests' user ID 2021-05-25 14:20:13 +02:00
Kévin Commaille
49c72e74f7
base: Add store tests for receipts 2021-05-25 11:57:03 +02:00
Kévin Commaille
a889bb3aca
base: Simplify decode_key_value 2021-05-25 10:26:56 +02:00
Damir Jelić
e058191b99 base: Correctly update the room info for invited rooms 2021-05-25 09:31:32 +02:00
Austin Ray
59c8652ce8
base: fix empty room name calculation
Step 3.iii of the naming algorithm[0] covers name calculation for empty
rooms; however, it isn't an else condition for steps 3.i and 3.ii. It's a
final conditional in the algorithm before returning the name. The
current implementation treats it as an else condition.

To fix this, use step 3.i and 3.ii to calculate a room name then check
if the user is alone. If alone, return "Empty room (was...)" containing
any former member names. If alone and there aren't any former members,
return "Empty room"

Fixes #133

[0] https://matrix.org/docs/spec/client_server/latest#calculating-the-display-name-for-a-room
2021-05-21 19:18:11 -04:00
Austin Ray
5670700f7f
base: fix room name's "and {} others" count
The current implementation uses number of invited and joined members for
"and {} others" message. This assigns rooms with 5 members the name "a,
b, c, and 5 others" suggesting 8 room members. The correct message is
"a, b, c, and 2 others". To get this, subtract number of heroes from
invited and joined member count.

Step 3.ii of the naming algorithm[0] confirms using a remaining users
count in the name.

[0] https://matrix.org/docs/spec/client_server/latest#calculating-the-display-name-for-a-room
2021-05-21 18:48:19 -04:00
Austin Ray
79025e3f40
base: split calculate_room_name()
Split `calculate_room_name()` into a high-level function using Matrix
data types and low-level function containing the core logic using plain
Rust data types. Since the low-level function uses simple data types,
unit testing becomes easier.
2021-05-21 17:25:59 -04:00
Austin Ray
c90e8ab483
base: use correct bound in naming algorithm
Step 3.ii of the name calculation algorithm[0] specifies the conditional
as `heroes < invited + joined - 1 AND invited + joined > 1`. However,
current implementation uses `invited + joined - 1 > 1` in the
conditional, which can trigger the conditional if the user is alone.

Correct this by using two variables representing `invited + joined` and
`invited_joined - 1` and updating the conditional. `invited + joined` is
kept as a variable since step 3.iii uses it for its conditional.

[0] https://matrix.org/docs/spec/client_server/latest#calculating-the-display-name-for-a-room
2021-05-21 14:51:59 -04:00
Kévin Commaille
64b5298881
base: Add support for read receipts 2021-05-20 17:14:57 +02:00
Damir Jelić
c122549e0d base: Correctly get the user ids of all room members 2021-05-18 08:29:10 +02:00
Jonas Platte
cd77441d1b
Upgrade ruma to 0.1.0 (crates.io release) 2021-05-17 02:57:36 +02:00
Jonas Platte
ffea84b64a
Use Instant instead of SystemTime to measure elapsed time 2021-05-15 17:23:31 +02:00
Jonas Platte
15540e84e3
Upgrade ruma 2021-05-15 17:22:32 +02:00
Devin Ragotzy
5f09d091cb Add cargo fmt to ci using nightly 2021-05-12 15:38:59 -04:00