347 Commits

Author SHA1 Message Date
Jonas Platte
53f76992e5
Update change logs 2020-03-29 14:25:44 +02:00
Akshay
f09ab98f17
Remove manual Serialize impl, use derive macro instead 2020-03-29 13:41:42 +02:00
Ragotzy.devin
8ea971b082
Derive Serialize in ruma_events!, use json EventType string for event_type field
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2020-03-24 14:25:50 +01:00
Ragotzy.devin
14df832005
Remove special handling of custom events 2020-03-24 11:31:47 +01:00
Jonas Platte
5a79b766c7
Revert "Remove special handling of custom events"
This reverts commit 539dd5f31dff172b5d6559378e33982d0a0c3333.
2020-03-24 11:31:36 +01:00
Ragotzy.devin
539dd5f31d
Remove special handling of custom events
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2020-03-24 11:27:55 +01:00
Ragotzy.devin
2a11207a9d
Add dummy event to to-device collection 2020-03-22 03:57:42 +01:00
Jonas Platte
0c6dd0ba32
Simplify proc_macro tests
… by moving them from ruma-events-macros to ruma-events and updating the
macros to work in different contexts (without items like FromRaw being
available at the calling crate's root)
2020-03-17 13:10:40 +01:00
Jonas Platte
016659a99c
Split impl FromRaw generation into its own macro 2020-03-16 23:27:32 +01:00
Jonas Platte
0efe82bf88
Move FromRaw, TryFromRaw into a new module 2020-03-16 22:48:21 +01:00
Jonas Platte
ddbb06f21d
Clean up code gen a bit 2020-03-16 21:22:56 +01:00
Jonas Platte
8a9bbb8c83
Don't deny(warnings) 2020-03-16 21:13:44 +01:00
Jonas Platte
5b15fe8a40
Remove unused imports 2020-03-16 20:56:59 +01:00
Jonas Platte
8f95d6f7cf
Update change log 2020-03-16 20:03:41 +01:00
Will Hakes
fc2d646dd3 Add new_plain constructor for TextMessageEventContent 2020-03-16 12:48:50 -06:00
Jonas Platte
94d9fc0a86
Bump the version to 0.17.0 2020-03-12 21:12:33 +01:00
Jonas Platte
53b27de6cd
Update changelog 2020-03-12 21:11:25 +01:00
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
Donough Liu
e60e502183 More tests for ruma-events-macros 2020-03-11 21:47:56 +08: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
096b40c579
Bump version 2020-02-19 00:29:50 +01:00
Jonas Platte
dc45a39c44
Update dependencies 2020-02-19 00:29:25 +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
b4e985e08d
Update change log 2020-02-18 22:11:57 +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
stoically
3128351031
Rename event_type when deserializing custom events 2020-01-01 20:20:13 +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
Jonas Platte
2754e14003
Update changelog 2019-12-15 19:33:41 +01:00
Jonas Platte
370c56ef31
Use quote::format_ident! 2019-12-13 20:42:20 +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
a57e867279
Fixup for previous commit 2019-11-24 20:52:53 +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