Add support for MSC2867 - Manually marking rooms as unread
This commit is contained in:
parent
684ffc7898
commit
68c9bb0930
@ -18,6 +18,8 @@ Improvements:
|
|||||||
- Implement `From<RoomPowerLevels>` for `ruma_common::push::PushConditionPowerLevelsCtx`
|
- Implement `From<RoomPowerLevels>` for `ruma_common::push::PushConditionPowerLevelsCtx`
|
||||||
- Add methods on `PowerLevels` to check if some actions are permitted based on
|
- Add methods on `PowerLevels` to check if some actions are permitted based on
|
||||||
the target user's power level.
|
the target user's power level.
|
||||||
|
- Add unstable support for manually marking rooms as unread through [MSC2867](https://github.com/matrix-org/matrix-spec-proposals/pull/2867)
|
||||||
|
and the room account data `m.marked_unread` event (unstable type `com.famedly.marked_unread`)
|
||||||
|
|
||||||
# 0.27.11
|
# 0.27.11
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ unstable-exhaustive-types = []
|
|||||||
unstable-msc1767 = []
|
unstable-msc1767 = []
|
||||||
unstable-msc2448 = []
|
unstable-msc2448 = []
|
||||||
unstable-msc2747 = []
|
unstable-msc2747 = []
|
||||||
|
unstable-msc2867 = []
|
||||||
unstable-msc3061 = []
|
unstable-msc3061 = []
|
||||||
unstable-msc3245 = ["unstable-msc3246"]
|
unstable-msc3245 = ["unstable-msc3246"]
|
||||||
# Support the m.room.message fallback fields from the first version of MSC3245,
|
# Support the m.room.message fallback fields from the first version of MSC3245,
|
||||||
|
@ -23,6 +23,9 @@ event_enum! {
|
|||||||
enum RoomAccountData {
|
enum RoomAccountData {
|
||||||
"m.fully_read" => super::fully_read,
|
"m.fully_read" => super::fully_read,
|
||||||
"m.tag" => super::tag,
|
"m.tag" => super::tag,
|
||||||
|
#[cfg(feature = "unstable-msc2867")]
|
||||||
|
#[ruma_enum(alias = "m.marked_unread")]
|
||||||
|
"com.famedly.marked_unread" => super::marked_unread,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Any ephemeral room event.
|
/// Any ephemeral room event.
|
||||||
|
@ -157,6 +157,8 @@ pub mod image;
|
|||||||
pub mod key;
|
pub mod key;
|
||||||
#[cfg(feature = "unstable-msc3488")]
|
#[cfg(feature = "unstable-msc3488")]
|
||||||
pub mod location;
|
pub mod location;
|
||||||
|
#[cfg(feature = "unstable-msc2867")]
|
||||||
|
pub mod marked_unread;
|
||||||
#[cfg(feature = "unstable-msc1767")]
|
#[cfg(feature = "unstable-msc1767")]
|
||||||
pub mod message;
|
pub mod message;
|
||||||
#[cfg(feature = "unstable-pdu")]
|
#[cfg(feature = "unstable-pdu")]
|
||||||
|
26
crates/ruma-events/src/marked_unread.rs
Normal file
26
crates/ruma-events/src/marked_unread.rs
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
//! Types for the [`m.marked_unread`] event.
|
||||||
|
//!
|
||||||
|
//! [`m.marked_unread`]: https://github.com/matrix-org/matrix-spec-proposals/pull/2867
|
||||||
|
|
||||||
|
use ruma_macros::EventContent;
|
||||||
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
/// The content of an `m.marked_unread` event.
|
||||||
|
///
|
||||||
|
/// Whether the room has been explicitly marked as unread.
|
||||||
|
///
|
||||||
|
/// This event appears in the user's room account data for the room the marker is applicable for.
|
||||||
|
#[derive(Clone, Debug, Deserialize, Serialize, EventContent)]
|
||||||
|
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||||
|
#[ruma_event(type = "com.famedly.marked_unread", kind = RoomAccountData)]
|
||||||
|
pub struct MarkedUnreadEventContent {
|
||||||
|
/// The current unread state.
|
||||||
|
pub unread: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl MarkedUnreadEventContent {
|
||||||
|
/// Creates a new `MarkedUnreadEventContent` with the given value.
|
||||||
|
pub fn new(unread: bool) -> Self {
|
||||||
|
Self { unread }
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
- Bump MSRV to 1.75
|
- Bump MSRV to 1.75
|
||||||
|
- re-export the `ruma-events`'s `unstable-msc2867` feature, manually marking rooms as unread
|
||||||
|
|
||||||
# 0.9.4
|
# 0.9.4
|
||||||
|
|
||||||
|
@ -183,6 +183,7 @@ unstable-msc2448 = [
|
|||||||
unstable-msc2654 = ["ruma-client-api?/unstable-msc2654"]
|
unstable-msc2654 = ["ruma-client-api?/unstable-msc2654"]
|
||||||
unstable-msc2666 = ["ruma-client-api?/unstable-msc2666"]
|
unstable-msc2666 = ["ruma-client-api?/unstable-msc2666"]
|
||||||
unstable-msc2747 = ["ruma-events?/unstable-msc2747"]
|
unstable-msc2747 = ["ruma-events?/unstable-msc2747"]
|
||||||
|
unstable-msc2867 = ["ruma-events?/unstable-msc2867"]
|
||||||
unstable-msc2870 = ["ruma-common/unstable-msc2870"]
|
unstable-msc2870 = ["ruma-common/unstable-msc2870"]
|
||||||
unstable-msc2965 = ["ruma-client-api?/unstable-msc2965"]
|
unstable-msc2965 = ["ruma-client-api?/unstable-msc2965"]
|
||||||
unstable-msc2967 = ["ruma-client-api?/unstable-msc2967"]
|
unstable-msc2967 = ["ruma-client-api?/unstable-msc2967"]
|
||||||
@ -232,6 +233,7 @@ __ci = [
|
|||||||
"unstable-msc2654",
|
"unstable-msc2654",
|
||||||
"unstable-msc2666",
|
"unstable-msc2666",
|
||||||
"unstable-msc2747",
|
"unstable-msc2747",
|
||||||
|
"unstable-msc2867",
|
||||||
"unstable-msc2870",
|
"unstable-msc2870",
|
||||||
"unstable-msc2965",
|
"unstable-msc2965",
|
||||||
"unstable-msc2967",
|
"unstable-msc2967",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user