Jonas Platte
2eba14f0cc
events: Rework the content traits
2023-01-16 21:28:53 +01:00
Kévin Commaille
1d8ea75f6f
events: Remove EventContent::from_parts
2023-01-10 11:37:31 +01:00
Kévin Commaille
9a9bd2c933
events: Remove Raw::deserialize_content
...
Replace it with deserialize_as or deserialize_with_type.
2023-01-10 11:37:31 +01:00
Kévin Commaille
dc591647f8
events: Remove StateUnsignedFromParts
...
Replace it with a bound on DeserializeOwned
2023-01-10 11:37:31 +01:00
Kévin Commaille
97b212795a
events: Create EventContentFromType
...
Implement it for:
- event contents that implement Deserialize
- event contents with event types with a suffix
- custom event contents
2023-01-10 11:37:31 +01:00
Kévin Commaille
ca78825e94
events: rename RoomEventType to TimelineEventType
2023-01-03 10:36:13 +01:00
Kévin Commaille
cd74cdcc0e
events: Generate PossiblyRedacted type for original state events
...
Fix deserialization of redacted prev_content
Can be overriden with the `custom_possibly_redacted` attribute
Co-authored-by: Jonas Platte <jplatte@element.io>
2023-01-03 10:28:40 +01:00
Jonas Platte
ad3c27d927
events: Make redacted_because non-optional in RedactedUnsigned
2022-12-15 12:47:27 +01:00
Jonas Platte
cdabe8e52d
events: Remove Serialize impls for all event types except ToDeviceEvent
2022-12-15 10:41:30 +01:00
Jonas Platte
a5c5b0b137
Make clippy happy
2022-12-09 11:45:04 +01:00
Kévin Commaille
5faff343a0
events: Use Reference instead of events::poll::ReferenceRelation
2022-11-25 22:33:37 +01:00
Kévin Commaille
6648954bd2
events: Move common relation structs under events::room::encrypted to events::relation
2022-11-25 22:33:37 +01:00
Kévin Commaille
aeaa4af776
events: Move relations under events::room::message to events::relation
2022-11-25 22:33:37 +01:00
Kévin Commaille
1ecd7effc0
events: Add tests for serde of encrypted relations
2022-11-25 18:51:12 +01:00
Kévin Commaille
dc18b12506
events: Fix deserialization without relation
2022-11-25 18:40:19 +01:00
Jonas Platte
94990f60f2
events: Don't skip serializing empty content of redacted events
2022-11-09 17:11:50 +01:00
Xiretza
69c807bdc1
events: Escape plain bodies in replies
...
Replies generate an HTML body even if the reply itself only consists of
plain text. In order to convert the plain text to HTML, it has to be
escaped, which did not happen previously.
2022-11-03 13:16:01 +01:00
Jonas Platte
c7e84c5249
Fix clippy lints
...
Automated using `cargo clippy --fix`.
2022-10-26 13:38:29 +02:00
Kévin Commaille
a3675e61bf
events: Add method to construct a replacement
2022-10-21 10:40:33 +02:00
Kévin Commaille
21bda6678d
events: Enable more markdown syntax
...
Enable markdown extensions that produces spec-compliant HTML.
2022-10-19 21:44:33 +02:00
Kévin Commaille
a710229d9d
events: Fix markdown content detection
...
Encoded HTML entities would be detected as a change.
Use the parsed events instead to check if markdown syntax was detected.
2022-10-19 21:44:33 +02:00
Kévin Commaille
7c0f7ba5f1
events: Make Replacement generic over the parent type
...
Because the new content must be of the same type.
2022-10-17 20:27:49 +02:00
Kévin Commaille
ec853e968a
events: Generate structs without relation for events that can be replaced
2022-10-17 20:27:49 +02:00
Kévin Commaille
99ae790446
events: Remove redundant tests
...
There are similar tests in the relations module
2022-10-10 18:23:03 +02:00
Kévin Commaille
4e2dac30be
events: Stabilize support for event replacements
2022-10-10 18:23:03 +02:00
Kévin Commaille
994136b9b8
events: Add thread-aware methods to RoomMessageEventContent
2022-10-10 17:55:08 +02:00
Kévin Commaille
003f0abebf
events: Stabilize current support for threads
2022-10-10 17:55:08 +02:00
Jonas Platte
06bc576571
events: Simplify serialize_and_deserialize_from_display_form test
...
We don't need to test every single event type.
2022-09-22 11:42:49 +02:00
Jonas Platte
b7b7d043f3
events: Add RoomMessageEventContent::make_reply_to
...
… and deprecate reply constructors.
2022-09-14 10:02:25 +02:00
Jonas Platte
aa8e48d1c3
events: Allow customizing the unsigned type of state events
2022-09-12 13:10:10 +02:00
Jonas Platte
674137c41d
events: Use CanBeEmpty trait for skipping unsigned serialization
2022-09-12 11:44:05 +02:00
Jonas Platte
914e5c21e9
events: Rename Any[Sync]RoomEvent to Any[Sync]TimelineEvent
2022-08-24 17:43:42 +02:00
Kévin Commaille
6f3d9fd327
events: Support m.html shortcut for MessageContent
2022-07-27 14:31:18 +02:00
Kévin Commaille
ed8990c3fd
events: Allow to create custom MessageEventContents
2022-07-27 14:31:18 +02:00
Kévin Commaille
635480796d
common: Add support for private read receipts
...
According to MSC2285
2022-07-18 11:18:55 +02:00
Kévin Commaille
cac7e09429
events: Add methods to sanitize messages
...
Can also remove rich reply fallbacks
Behind the `unstable-sanitize` feature.
Co-authored-by: Jonas Platte <jplatte@matrix.org>
2022-06-24 19:13:46 +02:00
Kévin Commaille
8081878934
events: Remove m.room.message.feedback
...
According to MSC3582
2022-06-20 18:34:06 +02:00
Kévin Commaille
e0de3d164b
events: Make more test assertions more helpful
2022-06-14 10:54:18 +02:00
Kévin Commaille
7008161727
events: Split more test assertions
2022-06-04 17:01:56 +02:00
Jonas Platte
a8e7c47bbe
Remove RoomName type
2022-06-03 11:40:33 +02:00
Jonas Platte
31d526ebfd
events: Clean up location event tests
2022-06-03 10:29:18 +02:00
Jonas Platte
8912182c56
Increase usage of implicit named arguments in format strings
2022-06-03 10:06:28 +02:00
Jonas Platte
73c2963ebd
Enforce consistent semicolons after ()
-typed expressions in blocks
2022-06-03 08:40:16 +02:00
Kévin Commaille
906d576a27
Implement Improved Signalling for 1:1 VoIP
...
According to MSC2746
2022-05-30 14:09:58 +02:00
Jonas Platte
5f902851af
Upgrade to Rust 2021
2022-05-27 12:04:23 +02:00
Kévin Commaille
a796b5e54d
events: Split more test assertions
2022-05-27 11:25:52 +02:00
Kévin Commaille
c3d573e943
events: Add support for polls
...
According to MSC3381
2022-05-25 12:03:45 +02:00
Jonas Platte
b34bfaf1f6
Replace matches crate with assert_matches
2022-05-24 18:07:29 +02:00
Kévin Commaille
1c90770d93
events: Split SessionDescription between Answer and Offer
2022-05-24 14:40:30 +02:00
Kévin Commaille
74423b7a4e
events: Split EventMeta between struct and field attributes
2022-05-16 17:08:36 +02:00