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
3ec8218158
state-res: Update fetch_state type
2022-04-15 12:06:09 +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
ce785064a9
Use RoomEventType instead of EventType for PDUs and power levels
2022-03-16 12:20:17 +01:00
Timo Kösters
83e46b6aea
state-res: Fix restricted joins
2022-03-14 15:02:21 +01:00
Timo Kösters
1ab97ddbe5
state-res: Fix knocking support
2022-03-11 12:38:39 +00:00
Kévin Commaille
bdcf07be87
common: Merge ruma-serde into ruma-common
2022-03-10 12:11:00 +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
Kévin Commaille
c3f9a3cb70
common: Merge ruma-events into ruma-common
2022-03-04 11:45:07 +00:00
Jonathan de Jong
936bb64e84
Update links to spec.matrix.org/v1.2
2022-02-18 19:45:04 +01:00
Jonas Platte
215cb35806
Clean up import grouping / ordering
2022-02-18 11:20:39 +01:00
Jonas Platte
a55df1ef9d
state-res: Remove unstable-spec feature
...
Everything that was gated behind it was stabilized with Matrix v1.2.
2022-02-02 23:25:52 +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
3ed7c8a643
state-res: Move knocking logic out of unstable-pre-spec
2022-02-01 21:08:19 +01:00
Jonas Platte
4c859c5aeb
Introduce a Base64 type and use it where applicable
2022-01-13 16:22:21 +01:00
Jonas Platte
1bdeebbd00
state-res: Reduce indentation by adding early returns
2022-01-13 13:52:43 +01:00
Jonas Platte
7290860019
state-res: Add support for room version 8 join restrictions
...
Co-authored-by: Devin Ragotzy <d6ragotzy@wmich.edu>
2021-12-17 18:58:32 +01:00
Jonas Platte
96374a7517
state-res: Rename RoomVersion::VERSION{num} to RoomVersion::V{num}
2021-12-04 18:59:39 +01:00
Devin Ragotzy
7f0913ccd7
state-res: Add membership check for Knock behind unstable feature
2021-12-04 18:48:03 +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
3ce578f384
identifiers: Make UserId a DST
2021-11-26 00:40:40 +01:00
Jonas Platte
04080085f9
events: Include all event type segments in Rust type names
2021-10-02 21:25:21 +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
a6a1224652
state-res: Make functions more general
...
Don't require different parameters to use the same impl Event.
2021-09-13 19:02:36 +02:00
Jonas Platte
0999e420ae
state-res: Return borrowed content in Event method
2021-09-13 19:02:36 +02:00
Jonas Platte
118aa8fc4a
state-res: Make usage of Arc optional
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
2b7ab82401
state-res: Remove unneeded .as_deref()
call
2021-09-13 19:02:36 +02:00
Jonas Platte
00a59d0528
state-res: Reduce unnecessary Arc usage
2021-09-13 19:02:35 +02:00
Jonas Platte
2d83cf9a03
state-res: Remove unused functions
2021-09-13 19:02:35 +02:00
Jonas Platte
f65b8b63e2
state-res: Make most functions in event_auth private
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
1a4b7903b8
state-res: Replace if let with match
2021-09-13 19:02:35 +02:00
Jonas Platte
17ffade52b
state-res: Use named fields instead of multiline messages for tracing events
2021-09-13 19:02:35 +02:00
Jonas Platte
43c8df18ad
state-res: Use match instead of repeatedly comparing the same variable
2021-09-13 19:02:34 +02:00
Jonas Platte
b4c22d5783
state-res: Further simplify valid_membership_change
2021-09-13 19:02:34 +02:00
Jonas Platte
22cee51e1a
state-res: Replace two uses of map_or with simpler match
2021-09-13 19:02:34 +02:00
Jonas Platte
d1fa58abb2
state-res: Make logic a bit easier to read
2021-09-13 19:02:34 +02:00
Jonas Platte
d8637d3b30
state-res: Replace map_or_else with simpler alternatives
2021-09-13 19:02:34 +02:00
Jonas Platte
4d0064330a
state-res: Inline get_named_level
2021-09-13 19:02:34 +02:00
Jonas Platte
8b4d019861
state-res: More fetch_state deduplication
2021-09-13 19:02:34 +02:00
Jonas Platte
f9f4106757
state-res: Don't call .to_string() for server name comparison
2021-09-13 19:02:34 +02:00
Jonas Platte
7f4eba5a5c
state-res: Inline get_user_power_level
2021-09-13 19:02:34 +02:00
Jonas Platte
4259e9ec0c
state-res: Deduplicate a few redundant function calls
2021-09-13 19:02:34 +02:00
Jonas Platte
f00b4a0984
state-res: Remove fetch_state parameter from a few more functions
2021-09-13 19:02:34 +02:00