Re-introduce dedicated event types as type alises
This commit is contained in:
parent
d4a196f682
commit
1e365c6a2d
@ -5,8 +5,12 @@ use ruma_events_macros::MessageEventContent;
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use super::SessionDescription;
|
use super::SessionDescription;
|
||||||
|
use crate::MessageEvent;
|
||||||
|
|
||||||
/// This event is sent by the callee when they wish to answer the call.
|
/// This event is sent by the callee when they wish to answer the call.
|
||||||
|
pub type AnswerEvent = MessageEvent<AnswerEventContent>;
|
||||||
|
|
||||||
|
/// The payload for `AnswerEvent`.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize, MessageEventContent)]
|
#[derive(Clone, Debug, Deserialize, Serialize, MessageEventContent)]
|
||||||
#[ruma_event(type = "m.call.answer")]
|
#[ruma_event(type = "m.call.answer")]
|
||||||
pub struct AnswerEventContent {
|
pub struct AnswerEventContent {
|
||||||
|
@ -10,6 +10,11 @@ use ruma_events_macros::EphemeralRoomEventContent;
|
|||||||
use ruma_identifiers::{EventId, UserId};
|
use ruma_identifiers::{EventId, UserId};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
use crate::EphemeralRoomEvent;
|
||||||
|
|
||||||
|
/// Informs the client who has read a message specified by it's event id.
|
||||||
|
pub type ReceiptEvent = EphemeralRoomEvent<ReceiptEventContent>;
|
||||||
|
|
||||||
/// The payload for `ReceiptEvent`.
|
/// The payload for `ReceiptEvent`.
|
||||||
///
|
///
|
||||||
/// A mapping of event ID to a collection of receipts for this event ID. The event ID is the ID of
|
/// A mapping of event ID to a collection of receipts for this event ID. The event ID is the ID of
|
||||||
|
@ -1,13 +1,18 @@
|
|||||||
//! Types for the *m.room_key* event.
|
//! Types for the *m.room_key* event.
|
||||||
|
|
||||||
use super::Algorithm;
|
|
||||||
use ruma_events_macros::BasicEventContent;
|
use ruma_events_macros::BasicEventContent;
|
||||||
use ruma_identifiers::RoomId;
|
use ruma_identifiers::RoomId;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
use super::Algorithm;
|
||||||
|
use crate::BasicEvent;
|
||||||
|
|
||||||
/// This event type is used to exchange keys for end-to-end encryption.
|
/// This event type is used to exchange keys for end-to-end encryption.
|
||||||
///
|
///
|
||||||
/// Typically it is encrypted as an *m.room.encrypted* event, then sent as a to-device event.
|
/// Typically it is encrypted as an *m.room.encrypted* event, then sent as a to-device event.
|
||||||
|
pub type RoomKeyEvent = BasicEvent<RoomKeyEventContent>;
|
||||||
|
|
||||||
|
/// The payload for `RoomKeyEvent`.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize, BasicEventContent)]
|
#[derive(Clone, Debug, Deserialize, Serialize, BasicEventContent)]
|
||||||
#[ruma_event(type = "m.room_key")]
|
#[ruma_event(type = "m.room_key")]
|
||||||
pub struct RoomKeyEventContent {
|
pub struct RoomKeyEventContent {
|
||||||
|
@ -3,9 +3,12 @@
|
|||||||
use ruma_events_macros::MessageEventContent;
|
use ruma_events_macros::MessageEventContent;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::room::ImageInfo;
|
use crate::{room::ImageInfo, MessageEvent};
|
||||||
|
|
||||||
/// A sticker message.
|
/// A sticker message.
|
||||||
|
pub type StickerEvent = MessageEvent<StickerEventContent>;
|
||||||
|
|
||||||
|
/// The payload for `StickerEvent`.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize, MessageEventContent)]
|
#[derive(Clone, Debug, Deserialize, Serialize, MessageEventContent)]
|
||||||
#[ruma_event(type = "m.sticker")]
|
#[ruma_event(type = "m.sticker")]
|
||||||
pub struct StickerEventContent {
|
pub struct StickerEventContent {
|
||||||
|
@ -4,7 +4,12 @@ use ruma_events_macros::EphemeralRoomEventContent;
|
|||||||
use ruma_identifiers::UserId;
|
use ruma_identifiers::UserId;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
use crate::EphemeralRoomEvent;
|
||||||
|
|
||||||
/// Informs the client who is currently typing in a given room.
|
/// Informs the client who is currently typing in a given room.
|
||||||
|
pub type TypingEvent = EphemeralRoomEvent<TypingEventContent>;
|
||||||
|
|
||||||
|
/// The payload for `TypingEvent`.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize, EphemeralRoomEventContent)]
|
#[derive(Clone, Debug, Deserialize, Serialize, EphemeralRoomEventContent)]
|
||||||
#[ruma_event(type = "m.typing")]
|
#[ruma_event(type = "m.typing")]
|
||||||
pub struct TypingEventContent {
|
pub struct TypingEventContent {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user