Jonas Platte
3f74ba3270
Box optional sub-structs in avatar and message events
...
… to heavily decrease the size of some types.
Most importantly: MessageEventContent goes from 640 to 104 bytes in size
2020-06-04 17:48:52 +02:00
Jonas Platte
2eb29abd74
Remove FIXME in member.rs
...
This is being adressed in the spec, see
https://github.com/matrix-org/matrix-doc/pull/2591
2020-06-02 12:16:51 +02:00
Jonas Platte
da7a97d490
Fixup for 16b9557
2020-05-31 22:56:51 +02:00
Jonas Platte
16b9557d74
Consolidate formatted body fields for message events
2020-05-31 16:10:01 +02:00
Jonas Platte
70b3ff2737
Update Matrix specification links
2020-05-31 15:50:17 +02:00
Timo Kösters
4d09416cd1
Add alt_aliases to CanonicalAliasEventContent
2020-05-30 17:51:23 +02:00
Jake Waksbaum
e05fdf84fd
Replace serde/strum renames with rename_all
...
Instead of applying a `#[serde(rename = "foo")]` or `#[strum(serialize =
"foo")]` to each field of a struct or variants of an enum, apply the
appropriate `#[serde(rename_all = "style")]` or `#[strum(serialize_all =
"style")]` to the struct/enum.
In addition, in the places where the `lowercase` style is used and all
the fields/variants are a single word, replace that with `snake_case`,
since that seems to be the default everywhere with multi-word
fields/variants.
2020-05-29 10:59:33 -04:00
Jake Waksbaum
d84de004c8
Replace impl_enum with strum::{EnumString,Display}
...
Replace the impl_enum! macro, which automatically derives instances of
std::fmt::Display and std::string::FromStr, with derive macros from the
strum crate (Display and EnumString resp.).
Closes #90 .
2020-05-29 10:59:33 -04:00
Jonas Platte
a398be6dd1
Fix test for m.room.create event
2020-05-26 10:25:23 +02:00
Jonas Platte
d3ff2b65a7
Implement Default for PowerLevelsEventContent
2020-05-26 10:24:14 +02:00
Jonas Platte
512496baeb
Add skip_serializing_if to CreateEventContent
2020-05-26 10:04:57 +02:00
Jonas Platte
114f739d43
Re-add type field serialization for MessageEvent
...
It was removed in b8eafc3f5937589f1c75dac74ceb796041a72b82, probably by
accident
2020-05-24 18:44:06 +02:00
Jonas Platte
5a0935cd6b
Fix message test naming
2020-05-24 18:29:33 +02:00
Jonas Platte
c2e3298b2a
Fix duplicate msgtype field in m.message serialization
2020-05-03 23:11:34 +02:00
Jonas Platte
0b26d71537
Re-run cargo fmt
2020-05-02 23:36:03 +02:00
Jonas Platte
b8eafc3f59
Update room::message
...
* Derive Deserialize for raw::MessageEventContent
* Remove MessageType
2020-05-02 23:25:46 +02:00
Jonas Platte
2f706d9a85
Remove invalid variant from room::message::MessageEventContent
2020-05-02 23:12:50 +02:00
Jonas Platte
fc78e49d49
Update representation of encrypted event content
2020-05-02 22:54:42 +02:00
Jonas Platte
17faaaa56e
Bump MSRV to 1.40.0
2020-05-02 22:14:05 +02:00
Jonas Platte
f65615075e
Update serde attrs for room::message::LimitType
2020-05-02 21:28:13 +02:00
Jonas Platte
51ad28081e
Use ruma_event! for room::server_acl
2020-05-02 21:25:02 +02:00
Jonas Platte
24f519ba29
Update serde attrs in room::guest_access
2020-05-02 18:49:12 +02:00
Jonas Platte
08418daeb2
Remove NotificationPowerLevels::is_default
2020-05-02 14:16:31 +02:00
Jonas Platte
ca5c65ef10
Revise trait implementations
2020-05-02 14:15:13 +02:00
Jonas Platte
18a37efcac
Update room::name tests
2020-05-02 14:08:16 +02:00
Jonas Platte
f23d7414ec
Update json literal formatting
2020-05-02 11:10:31 +02:00
Jonas Platte
8e4ff82a83
Stop relying on PartialEq for tests
2020-05-02 00:17:41 +02:00
Jonas Platte
752ea73010
Update serde attrs in room::member
2020-05-01 20:19:55 +02:00
Jonas Platte
28136cf1f6
Update serde attrs in room::history_visibility
2020-05-01 20:03:43 +02:00
Jonas Platte
6e1f8ded2d
Add format, formatted_body to NoticeMessageEventContent
2020-05-01 12:54:37 +02:00
Jonas Platte
a19401c076
Update serde attrs in room::message::feedback
2020-05-01 12:32:49 +02:00
Jonas Platte
d7e2411a68
Use ruma_event! for room::power_levels
2020-05-01 12:14:44 +02:00
Jonas Platte
c00a8cc52e
Update serde attr, add comment
2020-04-30 18:19:35 +02:00
Jonas Platte
0d305d8f24
Update ruma_serde to 0.1.2
2020-04-30 18:07:20 +02:00
Jonas Platte
fd5527da78
Reorder derives (std first)
2020-04-29 22:22:42 +02:00
Jonas Platte
c68df54eef
Simplify impl Deserialize for room::message::MessageEventContent
2020-04-29 22:20:22 +02:00
Jonas Platte
bd22c9d85c
Derive Serialize for types in room::message
2020-04-29 22:03:17 +02:00
Jonas Platte
8944b23a39
Derive Serialize for types in room::encrypted
2020-04-29 21:51:52 +02:00
Jonas Platte
aa42378c3d
Use ruma_event! macro for CanonicalAliasEvent
2020-04-29 21:31:49 +02:00
Jonas Platte
037a4faa6e
Merge serde attributes
2020-04-28 00:30:23 +02:00
Jonas Platte
f783ea6167
Fix unsigned field deserialization
2020-04-28 00:30:05 +02:00
Jonas Platte
55340d18c8
Add struct UnsignedData and update unsigned fields to use it
2020-04-28 00:03:48 +02:00
Jonas Platte
eb3a3e2163
Replace EventResult with EventJson, simplify InvalidEvent
2020-04-22 21:24:39 +02:00
poljar
df05e88793
room-messages: Add the ability to send encrypted room messages
2020-04-22 21:23:41 +02:00
Jonas Platte
2480bb292a
Replace HashMap with BTreeMap
2020-04-19 17:46:36 +02:00
Jonas Platte
dc0a9f88ba
Change timestamp types from UInt to SystemTime
2020-04-17 22:43:30 +02:00
Jonas Platte
5768737cbe
Remove needless clone
2020-04-17 22:43:14 +02:00
Jonas Platte
5623e71e9b
Fix a typo
2020-04-17 11:57:18 +02:00
PipsqueakH
a9e1a2b0b0
Replace all remaining manual implementations by derives
2020-04-05 19:37:04 +02:00
Akshay
8915339e56
Rewrite tests to use serde_json::json!
instead of raw strings
2020-03-31 16:07:09 +02:00