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.push_rules",
"m.room_key",
"m.tag",
]
}

View File

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