Add TagEvent type alias

This commit is contained in:
Jonas Platte 2020-06-10 00:19:33 +02:00
parent 7491b33e81
commit 47a4dc51c6
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
2 changed files with 12 additions and 11 deletions

View File

@ -9,6 +9,7 @@ event_enum! {
"m.ignored_user_list", "m.ignored_user_list",
"m.push_rules", "m.push_rules",
"m.room_key", "m.room_key",
"m.tag",
] ]
} }

View File

@ -2,19 +2,19 @@
use std::collections::BTreeMap; use std::collections::BTreeMap;
use ruma_events_macros::ruma_event; use crate::BasicEvent;
use ruma_events_macros::BasicEventContent;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
ruma_event! { /// Informs the client of tags on a room.
/// Informs the client of tags on a room. pub type TagEvent = BasicEvent<TagEventContent>;
TagEvent {
kind: Event, /// The payload for `TagEvent`.
event_type: "m.tag", #[derive(Clone, Debug, Deserialize, Serialize, BasicEventContent)]
content: { #[ruma_event(type = "m.tag")]
pub struct TagEventContent {
/// A map of tag names to tag info. /// A map of tag names to tag info.
pub tags: BTreeMap<String, TagInfo>, pub tags: BTreeMap<String, TagInfo>,
},
}
} }
/// Information about a tag. /// Information about a tag.