Kévin Commaille
05c88d6afc
state-res: Fix new clippy warnings
2024-02-14 13:07:21 +01:00
Jonas Platte
31331f3165
Bring back ruma-events
...
Co-authored-by: Kévin Commaille <zecakeh@tedomum.fr>
2023-08-28 10:23:54 +02:00
Jonas Platte
8e10064364
Enforce import grouping
...
Includes a few manual changes to make rustfmt behave a bit better.
2023-08-22 12:31:49 +02:00
Jonas Platte
3dac70ead9
Remove most unreachable visibility modifiers
2023-07-19 14:32:14 +02:00
Kévin Commaille
ca78825e94
events: rename RoomEventType to TimelineEventType
2023-01-03 10:36:13 +01:00
Jonas Platte
8912182c56
Increase usage of implicit named arguments in format strings
2022-06-03 10:06:28 +02:00
Jonas Platte
5f902851af
Upgrade to Rust 2021
2022-05-27 12:04:23 +02:00
Jonas Platte
d855ec33d6
identifiers: Update ToOwned implementations to use new types
...
… and a lot of changes that cascaded from that.
2022-04-20 10:39:36 +02:00
Jonas Platte
b3cea6b998
state-res: Use StateEventType over RoomEventType where applicable
2022-04-09 00:55:14 +02:00
Jonas Platte
7de3b4b649
events: Rework the event enum hierarchy
2022-04-05 14:29:17 +02:00
Jonas Platte
d87874314b
events: Add 'Original' prefix to unredacted types with a redacted form
2022-04-05 14:29:17 +02:00
Jonas Platte
24bd27a3a9
Remove origin field from PDUs
...
It has been removed from the spec, for details see
https://github.com/matrix-org/matrix-spec/pull/998
2022-03-30 08:44:40 +02:00
Jonas Platte
ce785064a9
Use RoomEventType instead of EventType for PDUs and power levels
2022-03-16 12:20:17 +01:00
Kévin Commaille
088d1872b7
common: Merge ruma-identifiers into ruma-common
2022-03-09 17:46:51 +00:00
gnieto
fca0f6a22b
Minor fix on join member auth rules
...
Previous code was not checking/enforcing rule 4.3.1
(https://spec.matrix.org/v1.2/rooms/v9/ ), which states that a room
member event (with a join membership) must be accepted only if it contains
a previous event which `state_key` is the room creator.
On top of that, it simplifies the public interface for `auth_rules`,
removing the need of (externally) compute `prev_event`, which, as a side
effect, should reduce the amount of times the previous event needs to be
fetched: It will only load it if the authorized event is a `m.room_member`
with a `Join` state.
Finally, I've splitted the join conditions so it's (hopefully) more
readable and apply auth rules in the same order as they
appear in the spec.
2022-03-08 08:27:47 +01:00
Jonas Platte
43c47ef676
state-res: Fix wrong import location
2022-03-04 17:00:00 +01:00
Kévin Commaille
c3f9a3cb70
common: Merge ruma-events into ruma-common
2022-03-04 11:45:07 +00:00
Kévin Commaille
acba6fbbc4
ci: Add the __ci feature
2022-02-11 22:17:49 +01:00
Jonas Platte
2706f24688
state-res: Move room version 8, 9 logic from unstable-pre-spec to unstable-spec
2022-02-01 21:37:11 +01:00
Jonas Platte
16f031fabb
state-res: Make the API generic over the event ID storage
2021-11-27 23:18:34 +01:00
Jonas Platte
9ed75241a6
state-res: Refactor lexicographical_topological_sort
...
Gets rid of unnecessary copying and makes things more explicit by using
a struct with named fields instead of a tuple for tie breaking.
Co-authored-by: Jonathan de Jong <jonathan@automatia.nl>
2021-11-26 20:22:57 +01:00
Jonas Platte
6b76d7813e
identifiers: Shorten RoomVersionId variant names
2021-11-26 01:07:26 +01:00
Jonas Platte
3ce578f384
identifiers: Make UserId a DST
2021-11-26 00:40:40 +01:00
Jonas Platte
2d4dbfe42f
identifiers: Make RoomId a DST
2021-11-26 00:04:28 +01:00
Jonas Platte
52608cc72c
identifiers: Make EventId a DST
2021-11-25 22:34:40 +01:00
Devin Ragotzy
7fbfe59091
state-res: Minor fixes & doc updates
2021-11-15 23:08:12 +01:00
Jonas Platte
56801780b6
Fix clippy lints
2021-10-29 23:11:24 +02:00
Jonas Platte
04080085f9
events: Include all event type segments in Rust type names
2021-10-02 21:25:21 +02:00
Amanda Graven
3b5f3cb5a6
events: Move JoinRulesEventContent.allow into JoinRules
2021-09-28 13:39:58 +00:00
Jonas Platte
c6144c2299
state-res: Fix state-res tests
...
Before, they wouldn't compile with the unstable-exhaustive-types feature
active on ruma-state-res, but not on ruma-events.
2021-09-28 14:27:42 +02:00
Jonas Platte
69a97232b9
state-res: Clean up test code
2021-09-17 23:52:28 +02:00
Jonas Platte
a9985d7763
events / state-res: Use RawJsonValue over JsonValue for event content
2021-09-15 20:58:42 +02:00
Jonas Platte
9cb9b1104a
state-res: Remove unused Event trait methods
2021-09-15 18:15:01 +02:00
Jonas Platte
0999e420ae
state-res: Return borrowed content in Event method
2021-09-13 19:02:36 +02:00
Jonas Platte
889406b6c2
state-res: Make resolve more general by using impl IntoIterator for state_sets
2021-09-13 19:02:36 +02:00
Jonas Platte
3830dcddc2
state-res: Simplify tests a bit
2021-09-13 19:02:36 +02:00
Jonas Platte
717fd1198d
state-res: Remove unnecessary unwrap call
2021-09-13 19:02:36 +02:00
Jonas Platte
f0cd82dae7
state-res: Refactor test_utils
2021-09-13 19:02:36 +02:00
Jonas Platte
bc1e7eb1fc
state-res: Remove unused code from test_utils
2021-09-13 19:02:36 +02:00
Jonas Platte
0cd91ed61e
state-res: Don't import-rename crate root
2021-09-13 19:02:35 +02:00
Jonas Platte
1e19de9579
state-res: Return borrows from Event::{prev_events, auth_events}
2021-09-13 19:02:35 +02:00
Jonas Platte
34a10b87c5
state-res: Return borrows from Event::{event_type, state_key}
2021-09-13 19:02:35 +02:00
Jonas Platte
290c61820b
state-res: Remove unused function parameters
2021-09-13 19:02:35 +02:00
Jonas Platte
0a93780e83
state-res: Move tests/utils.rs to src/test_utils.rs
2021-09-13 19:02:34 +02:00