ruwuma/ruma-events/src/sticker.rs
Jonas Platte f304c04d1d Add 'ruma-events/' from commit '00692d532e26f58d48ead9589dc823403c6e59a5'
git-subtree-dir: ruma-events
git-subtree-mainline: d59a616e2c363507a89c92f34aa67e86ee2cfb49
git-subtree-split: 00692d532e26f58d48ead9589dc823403c6e59a5
2020-06-10 22:07:24 +02:00

26 lines
865 B
Rust

//! Types for the *m.sticker* event.
use ruma_events_macros::MessageEventContent;
use serde::{Deserialize, Serialize};
use crate::{room::ImageInfo, MessageEvent};
/// A sticker message.
pub type StickerEvent = MessageEvent<StickerEventContent>;
/// The payload for `StickerEvent`.
#[derive(Clone, Debug, Deserialize, Serialize, MessageEventContent)]
#[ruma_event(type = "m.sticker")]
pub struct StickerEventContent {
/// A textual representation or associated description of the sticker image. This could
/// be the alt text of the original image, or a message to accompany and further
/// describe the sticker.
pub body: String,
/// Metadata about the image referred to in `url` including a thumbnail representation.
pub info: ImageInfo,
/// The URL to the sticker image. This must be a valid `mxc://` URI.
pub url: String,
}