Jonas Platte
8fb0c9a160
Rename stripped::{StrippedState => AnyStrippedStateEvent, StrippedStateContent => StrippedStateEvent}
2020-03-12 21:07:50 +01:00
Jonas Platte
fdef9a12e6
Rename to_device::ToDevice to AnyToDeviceEvent
2020-03-12 21:02:04 +01:00
Donough Liu
7920445832
Implement helper method and more tests for MemberEvent
2020-03-12 20:45:51 +01:00
poljar
12d725113b
Implement a collection for to-device events
...
To-device events are received in a sync response in a separate field of
the response.
They are sent between dirrectly without involving a room and are not
permanently stored on the serever. They are mostly used to set up
encryption between devices.
This patch implements a enum which encapsulates many of the messages
that will appear in the to-device part of a sync response.
2020-03-11 13:01:37 +01:00
Jonas Platte
dce5ae5c39
Update serde tests
...
* macro => function
* json string => serde_json::Value
2020-03-11 12:55:37 +01:00
Donough Liu
b03eb0261f
Add more tests for Algorithm and EventType
2020-03-10 22:36:40 +01:00
Donough Liu
0ff395fe85
Move EventType and Algorithm outside
2020-03-10 05:52:28 +08:00
poljar
f1bc5438b3
room/encrypted: Fix the OlmV1 deserialization
...
A m.room.encrypted event with the algorithm type
"m.olm.v1.curve25519-aes-sha2" will have multiple ciphertext values.
The documentation for the struct field even mentions that the
ciphertext is a map, yet it only expected one body and one message type.
This patch fixes the de-serialization and puts all the available
ciphertext values into a hashmap.
2020-03-09 11:33:08 +01:00
Marcel
c81cc48aeb
Fix missing "m." in serialization of the "m.relates_to" key
2020-02-28 11:38:44 +01:00
Jonas Platte
9d7ff18463
Remove collections::only::raw export
2020-02-21 12:18:21 +01:00
Jonas Platte
ac26770319
Add collection conversion functions
2020-02-18 23:53:54 +01:00
Jonas Platte
3a6d6140a3
Fix clippy warning
2020-02-18 23:32:06 +01:00
Jonas Platte
78eae67fac
Make all room_id's in events (not event content) optional
2020-02-18 22:08:38 +01:00
Jonas Platte
a10da82ec0
Fix typo
2020-02-18 21:11:08 +01:00
Jonas Platte
d31583a826
Silence clippy warning
2020-02-13 12:11:43 +01:00
Jonas Platte
2f95a299b7
Fix typo
2020-02-10 15:54:41 +01:00
Jonas Platte
c7d7212b00
Clean up previous commit, update tests
2019-12-17 11:50:56 +01:00
Jonas Platte
dd16d0f2f0
Allow *all* m.room.power_levels fields to be absent
2019-12-16 21:10:55 +01:00
Jonas Platte
1a3f6ed0b6
Derive Serialize, Deserialize impls for some enums
2019-12-15 20:26:06 +01:00
Jonas Platte
98f85df276
Remove unnecessary explicit lifetimes
2019-12-15 20:23:57 +01:00
Lu Fennell
9f463bb726
Add validation to NameEvent: name should not exceed 255 bytes
2019-11-24 21:01:29 +01:00
Jonas Platte
cf5fccaccc
Simplify TryFromRaw::try_from_raw
2019-11-24 17:40:13 +01:00
Jonas Platte
b9f5fd796e
Bump MSRV to 1.36.0
2019-11-24 15:43:13 +01:00
Jonas Platte
de80253e78
Add #![warn(rust_2018_idioms)], fix warnings
2019-11-12 01:23:01 +01:00
Jonas Platte
e9d55cbfac
Reduce macro duplication
2019-11-11 23:37:24 +01:00
Jonas Platte
a9840164cd
Derive Serialize for collection types
2019-11-11 23:26:12 +01:00
Jonas Platte
9e50de0d13
Remove unused trait impls on raw collection types
2019-11-11 23:18:58 +01:00
Jonas Platte
4d17769b2b
Update tests to use example.com instead of domain.com
...
because domain.com represents a business, while example.com is actually just an example domain
2019-11-11 20:48:24 +01:00
Jonas Platte
5a0a269cfe
Remove #![deny(warnings)]
2019-10-31 22:05:33 +01:00
Jonas Platte
63e32f2b01
Exhausively match EventType in collection deserilization code
2019-10-27 21:26:03 +01:00
Jonas Platte
3b78391fbc
Implement custom event deserialization
2019-10-27 21:01:28 +01:00
Jonas Platte
cbe22a84eb
Remove commented-out code
2019-10-27 20:56:32 +01:00
Jonas Platte
ce6937c1a0
Update docs
2019-10-24 22:55:10 +02:00
Jonas Platte
1af436b775
Simplify InvalidEvent, update its documentation
2019-10-24 22:26:20 +02:00
Jonas Platte
2dd9ddd4e8
Allow clippy warning use_self
2019-10-23 02:53:00 +02:00
Jonas Platte
09378eb410
Refactor collection deserialization
2019-10-23 02:24:07 +02:00
Jonas Platte
60c817e1b0
Restore Rust 1.34.2 compatibility
2019-10-23 02:09:34 +02:00
Jonas Platte
c925cd13f1
Update documentation
2019-10-23 01:42:06 +02:00
Jonas Platte
63a012d338
Remove useless .to_owned()
2019-10-23 01:41:37 +02:00
Jonas Platte
922a35eced
Refactor InvalidEvent
2019-10-23 01:41:09 +02:00
Jonas Platte
665fe4f4f4
Move (de)serialization helpers to util module
2019-10-22 23:56:03 +02:00
Jonas Platte
777f3b9686
Re-run rustfmt
2019-10-22 23:52:44 +02:00
Florian Jacob
c21ecd9b6d
Add more documentation to vec_as_map_of_empty
2019-10-22 23:44:18 +02:00
Jonas Platte
7e5ca6e7af
Simplify StrippedStateContent deserialization
2019-10-21 14:20:53 +02:00
Jonas Platte
7e210476fa
Re-enable #![deny(...)]
attributes
2019-10-19 02:31:54 +02:00
Jonas Platte
9536099f38
Replace custom Void type, change TryFromRaw::Err bound
2019-10-19 02:13:21 +02:00
Jonas Platte
63b85f524c
Get rid of redundant clone()s (thanks to clippy)
2019-10-18 23:48:48 +02:00
Jonas Platte
7f771bc788
Fix failing tests
2019-10-18 00:46:35 +02:00
Jonas Platte
85990676cd
Remove impl Serialize for EventResult
2019-10-17 00:21:52 +02:00
Jonas Platte
982d978d94
Almost finish deserialize impl's
2019-10-16 21:40:30 +02:00