Commit Graph

14300 Commits

Author SHA1 Message Date
Richard van der Hoff
4f2cd1c5ec crypto(test): utility function for creating VerificationMachines 2025-09-12 17:13:08 +01:00
Andy Balaam
8a6c4fdcb4 Return a MessageType from verification_request_content 2025-09-12 17:13:08 +01:00
Richard van der Hoff
b8cbd6c448 Merge pull request #5654 from matrix-org/rav/identity_test_cleanups
crypto: Simplify `PrivateCrossSigningIdentity::with_account`
2025-09-12 14:21:19 +01:00
Ivan Enderlin
5ccbc1c378 fix(sqlite): Empty the cache after the introduction of TimelineEvent::timestamp.
After the merge of
https://github.com/matrix-org/matrix-rust-sdk/pull/5648, we want
all events to get a `TimelineEvent::timestamp` value (extracted from
`origin_server_ts`).

To accomplish that, we are emptying the event cache. New synced events
will be built correctly, with a valid `TimelineEvent::timestamp`,
allowing a clear, stable situation.
2025-09-12 15:06:46 +02:00
Richard van der Hoff
0002ea46ab crypto: inline PrivateCrossSigningIdentity::with_account
This was now only used in one place, and I think it makes more sense to inline
it into olm::Account than leave it in `PrivateCrossSigningIdentity`.
2025-09-12 14:04:02 +01:00
Richard van der Hoff
bb46dc74d0 crypto: Factor out PrivateCrossSigningIdentity::for_account
It turns out that creating a cross-signing identity *without* the upload
requests is a very common thing to do, especially in tests. We can simplify
some code by factoring it out as a new helper.
2025-09-12 14:04:02 +01:00
Shrey Patel
c2bc465c06 feat(base): Add get_room_events to EventCacheStore trait and impls. 2025-09-12 12:59:22 +02:00
Ivan Enderlin
b788ba0d73 feat(base) LatestEventValue::timestamp uses the new TimelineEvent::timestamp method.
This patch updates `LatestEventValue::timestamp` to use
the new `TimelineEvent::timestamp` method in case of a
`LatestEventValue::Remote`.
2025-09-12 11:43:49 +02:00
Ivan Enderlin
53a74f3949 feat(common): Add TimelineEvent::timestamp.
This patch adds the `timestamp` field to `TimelineEvent`.
It's a copy of the `origin_server_ts` value, parsed as an
`Option<MilliSecondsSinceUnixEpoch>`. It's `None` if the parsing failed,
or if the `TimelineEvent` was deserialised from a version before this
new field was added.

A new `extract_timestamp` function is added for this purpose. It
protects against malicious `origin_server_ts` where the value can be
set to year 2100 for example. The only protection we are adding here is
to take the `min(origin_server_ts, now())`, so that the event can never
been “in the future”.

It doesn't protect against a malicious value like 0. It's non-trivial to
define a minimum timestamp for an event.

When a `TimelineEvent` is mapped from one kind to another kind, the
`timestamp` is carried over. To achieve that, new `to_decrypted` and
`to_utd` methods are added.

The rest of the code is updated accordingly.
2025-09-12 11:43:49 +02:00
Damir Jelić
215ca3d798 Merge pull request #5641 from matrix-org/feat/element-recent-emojis
feat: Add Element recent emojis for shared emoji reactions
2025-09-12 11:32:12 +02:00
Jorge Martín
87032a36bd fix: use the same ordering as in Element Web: first, sort by count descending, then by recency for items with equal count 2025-09-12 08:21:14 +02:00
Jorge Martín
4f881b55f9 refactor: link to the Element Web implementation 2025-09-12 08:21:14 +02:00
Jorge Martín
bb9bdee4a7 refactor: fix doc comment issues 2025-09-12 08:21:14 +02:00
Jorge Martín
4216ec6113 test: Add serialization and deserialization tests for recent emojis 2025-09-12 08:21:14 +02:00
Jorge Martín
b2df2742bd refactor: Move the recent emoji functions from client to account.
Also, make sure updating the emojis first fetches the most up-to-date data.
2025-09-12 08:21:14 +02:00
Jorge Martín
163ed929fe refactor: Add docs to test helper 2025-09-12 08:21:14 +02:00
Jorge Martín
9776ae6acd refactor: rename feature to experimental-element-recent-emoji 2025-09-12 08:21:14 +02:00
Jorge Martín
68c2b89bf5 fix: Fix clippy 2025-09-12 08:21:14 +02:00
Jorge Martín
b744e5789a fix: Fix test in doc comment 2025-09-12 08:21:14 +02:00
Jorge Martín
231840f6ae refactor: Make the ci task also use the element-recent-emojis feature for different tasks 2025-09-12 08:21:14 +02:00
Jorge Martín
fc224b17c7 refactor(ui): Make toggle_reaction return a bool so we know if the emoji was added or removed 2025-09-12 08:21:14 +02:00
Jorge Martín
5522509e6b feat(ffi): Add bindings for the recent emojis 2025-09-12 08:21:14 +02:00
Jorge Martín
89fd0b5e53 feat(sdk): Allow adding and retrieving recent emojis
Include some tests.
2025-09-12 08:21:14 +02:00
Jorge Martín
eee1fa2b71 feat(sdk-base): Add Element recent emojis event
Add a feature for it too
2025-09-12 08:21:14 +02:00
Timo K
62763ca000 fix element call url "intent" serialization
Signed-off-by: Timo K <toger5@hotmail.de>
2025-09-12 07:52:37 +03:00
Johannes Marbach
5e573417cb fix(timeline): avoid replacing timeline items when the encryption info is unchanged
Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-09-11 15:48:39 +01:00
Damir Jelić
c3621f2bd1 Merge branch 'release-0.14' 2025-09-11 13:34:56 +02:00
Damir Jelić
0eac2a099f chore(base): Add the CVE ID for the power level panic to the changelog 2025-09-11 13:33:33 +02:00
Kévin Commaille
90eb403c18 sqlite: Drop media table from event cache store
Since the media store was split into a separate database.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2025-09-11 11:43:04 +01:00
Ivan Enderlin
878e02b652 doc(common): Rephrase the documentation of cross_process_lock a little bit. 2025-09-10 20:35:45 +02:00
Ivan Enderlin
bbe8f17b1a refactor(common): Rename LockStoreError to CrossProcessLockError.
This patch renames the `LockStoreError` enum to `CrossProcessLockError`
to be consistent with the other types in the same module.

The `BackingStoreError` variant is also renamed to `TryLockError`.
2025-09-10 20:35:45 +02:00
Ivan Enderlin
f65bb6016c refactor(common): Rename store_locks to cross_process_lock. 2025-09-10 20:35:45 +02:00
Ivan Enderlin
976eacb624 refactor(common): Rename BackingStore to TryLock.
This patch renames the `BackingStore` trait to `TryLock`. It also
renames the `CrossProcessLock::store` field to `locker`. It's not
necessarily a store, it can be anything.
2025-09-10 20:35:45 +02:00
Ivan Enderlin
5fe5cfd85f refactor(common): Rename CrossProcessStoreLock* to CrossProcessLock*.
This patch renames `CrossProcessStoreLock` and
`CrossProcessStoreLockGuard` to `CrossProcessLock` and
`CrossProcessLockGuard`.
2025-09-10 20:35:45 +02:00
Ivan Enderlin
0233ac906e chore(common): Simplify code.
This patch simplifies a code that does a surprising thing. The `#[cfg]`
isn't necessary here.
2025-09-10 20:35:45 +02:00
Damir Jelić
4cc1cd1913 chore(sdk): Better logs for the duplicate one-time key error 2025-09-10 13:09:35 +00:00
Valere
2248bbf6ab fix adding both final and dev id doesn't work with ruma alias 2025-09-10 13:07:48 +02:00
dragonfly1033
2afbdfae0b Split media store from event cache store. (#5568)
This PR is a start to the process of splitting the media store from the
event cache store. #5410

It contains:
* Split `MediaStore` trait from `EventCacheStore`. 
* Rename `EventCacheStoreMedia` to `MediaStoreInner`. 
* Move relevant tests into `MediaStoreIntegrationTests`.

This will be done over 3 PR's (reviewing 1, 2, 3 then merging 3 into 2
into 1).

A reminder comment for my own sanity:
This PR will not pass tests until after merging.

Current state of this PR:
- [x] Step 1 reviewed #5568
- [x] Step 2 reviewed #5569 
- [x] Step 3 reviewed #5571 
- [x] Step 3 merged into Step 2
- [x] Step 2 merged into Step 1
- [ ] Add changes to changelog.
- [ ] Ready to merge 🎉 

Note, may also want to: 
* Re-organize file structure
* Split/refactor benchmarks namely `benchmarks/benches/event_cache.rs`

<!-- description of the changes in this PR -->

- [ ] Public API changes documented in changelogs (optional)

<!-- Sign-off, if not part of the commits -->
<!-- See CONTRIBUTING.md if you don't know what this is -->
Signed-off-by: Shrey Patel shreyp@element.io

---------

Co-authored-by: Shrey Patel <shreyp@element.io>
2025-09-10 12:03:02 +02:00
Timo
d2ca0262ae feat(element-call url params): split url params into configuration and properties (#5560)
This PR is part of an onging effort to move responsiblity to the EC app
and out of the EX apps.

4 intends (f.ex `join_existing` `start_new_dm`... ) (as url paramters)
are introduced in recent element call versions. Those intends behave
like defaults. If an intend is set a set of url parameters are
predefined.
Not all params can be covered by the intend (for insteance the
`widget_id` or the `host_url`).
This PR splits the url parameters into configuration (things that can be
configured by the intent) and properties (things that still need to be
passed one by one)


The goal with this change is that EX only needs to configre the intent
once and the EC codebase can update the behavior in those 4 specific
scenarios in case new features come along (auto hangup when other
participants leave, send call ring notification...)


Signed-off-by: Timo K <toger5@hotmail.de>

<!-- description of the changes in this PR -->

- [ ] Public API changes documented in changelogs (optional)

<!-- Sign-off, if not part of the commits -->
<!-- See CONTRIBUTING.md if you don't know what this is -->
Signed-off-by:

---------

Signed-off-by: Timo K <toger5@hotmail.de>
2025-09-10 11:46:21 +02:00
Damir Jelić
f1064425bd Merge branch 'release-0.14' into poljar/merge-0.14-back-to-main 2025-09-10 11:20:39 +02:00
Damir Jelić
5ef3ecac8c chore: Allow the adler crate despite it being unmaintained matrix-sdk-base-0.14.1 2025-09-10 10:41:18 +02:00
Damir Jelić
6c537d74de chore: Release matrix-sdk-base version 0.14.1 2025-09-10 10:41:18 +02:00
Damir Jelić
476fe5f9d2 fix(base): Fix a panic when we encounter a power level at Int::Min 2025-09-10 10:41:18 +02:00
Damir Jelić
186132c248 test(base): Test how we normalize power levels at the int limits 2025-09-10 10:41:18 +02:00
Damir Jelić
0f90631d4a test(base): Add a proptest to validate our normalize_power_level method 2025-09-10 10:41:18 +02:00
Damir Jelić
80262f2f36 chore: Put the power level normalization logic into a separate function 2025-09-10 10:41:18 +02:00
Damir Jelić
91c5f8a01a chore: Add some missing PR links in our changelog 2025-09-10 10:41:18 +02:00
Valere
502d6d3095 widget capabilities rtc decline test 2025-09-09 18:22:49 +02:00
Valere
db4ce0bea5 widget-driver: Add read/send capabilities for rtc decline event 2025-09-09 18:22:49 +02:00
Shrey Patel
b0c0e0e0c4 feat(search): Add paginated search. 2025-09-09 16:24:25 +02:00