events: Move FullyReadEvent from EphemeralRoomEvent to BasicEvent

This commit is contained in:
Kévin Commaille 2021-05-08 22:19:54 +02:00 committed by GitHub
parent b610a725e8
commit bbb0b36536
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View File

@ -41,6 +41,7 @@ Breaking changes:
sticker::StickerEventContent sticker::StickerEventContent
``` ```
* Add `tag::TagName` type and use it for `tag::Tags` * Add `tag::TagName` type and use it for `tag::Tags`
* Move `FullyRead` from `EphemeralRoom` enum to `Basic` enum
Improvements: Improvements:

View File

@ -10,6 +10,7 @@ event_enum! {
events: [ events: [
"m.direct", "m.direct",
"m.dummy", "m.dummy",
"m.fully_read",
"m.ignored_user_list", "m.ignored_user_list",
"m.presence", "m.presence",
"m.push_rules", "m.push_rules",
@ -22,7 +23,6 @@ event_enum! {
/// Any ephemeral room event. /// Any ephemeral room event.
kind: EphemeralRoom, kind: EphemeralRoom,
events: [ events: [
"m.fully_read",
"m.receipt", "m.receipt",
"m.typing", "m.typing",
] ]

View File

@ -1,19 +1,19 @@
//! Types for the *m.fully_read* event. //! Types for the *m.fully_read* event.
use ruma_events_macros::EphemeralRoomEventContent; use ruma_events_macros::BasicEventContent;
use ruma_identifiers::EventId; use ruma_identifiers::EventId;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use crate::EphemeralRoomEvent; use crate::BasicEvent;
/// The current location of the user's read marker in a room. /// The current location of the user's read marker in a room.
/// ///
/// This event appears in the user's room account data for the room the marker is applicable /// This event appears in the user's room account data for the room the marker is applicable
/// for. /// for.
pub type FullyReadEvent = EphemeralRoomEvent<FullyReadEventContent>; pub type FullyReadEvent = BasicEvent<FullyReadEventContent>;
/// The payload for `FullyReadEvent`. /// The payload for `FullyReadEvent`.
#[derive(Clone, Debug, Deserialize, Serialize, EphemeralRoomEventContent)] #[derive(Clone, Debug, Deserialize, Serialize, BasicEventContent)]
#[ruma_event(type = "m.fully_read")] #[ruma_event(type = "m.fully_read")]
pub struct FullyReadEventContent { pub struct FullyReadEventContent {
/// The event the user's read marker is located at in the room. /// The event the user's read marker is located at in the room.