chore(base): Rename NotableTags to RoomNotableTags.

Now that `NotableTags` has replaced `RoomNotableTags` entirely, this
patch can rename `NotableTags` to `RoomNotableTags` as it's a better
name for it.

Note that this type is private to `matrix_sdk_base`, so it's fine to
rename it.
This commit is contained in:
Ivan Enderlin
2024-02-08 15:27:48 +01:00
parent 31ba7b82d8
commit 8b298dfd2f
3 changed files with 12 additions and 12 deletions

View File

@@ -112,8 +112,8 @@ pub struct BaseRoomInfo {
///
/// We are not interested by all the tags. Some tags are more important than
/// others, and this field collects them.
#[serde(skip_serializing_if = "NotableTags::is_empty", default)]
pub(crate) notable_tags: NotableTags,
#[serde(skip_serializing_if = "RoomNotableTags::is_empty", default)]
pub(crate) notable_tags: RoomNotableTags,
}
impl BaseRoomInfo {
@@ -297,14 +297,14 @@ impl BaseRoomInfo {
}
pub fn handle_notable_tags(&mut self, tags: &Tags) {
let mut notable_tags = NotableTags::empty();
let mut notable_tags = RoomNotableTags::empty();
if tags.contains_key(&TagName::Favorite) {
notable_tags.insert(NotableTags::FAVOURITE);
notable_tags.insert(RoomNotableTags::FAVOURITE);
}
if tags.contains_key(&TagName::LowPriority) {
notable_tags.insert(NotableTags::LOW_PRIORITY);
notable_tags.insert(RoomNotableTags::LOW_PRIORITY);
}
self.notable_tags = notable_tags;
@@ -318,7 +318,7 @@ bitflags! {
/// others, and this struct describe them.
#[repr(transparent)]
#[derive(Debug, Default, Clone, Copy, Deserialize, Serialize)]
pub(crate) struct NotableTags: u8 {
pub(crate) struct RoomNotableTags: u8 {
/// The `m.favourite` tag.
const FAVOURITE = 0b0000_0001;
@@ -358,7 +358,7 @@ impl Default for BaseRoomInfo {
topic: None,
rtc_member: BTreeMap::new(),
is_marked_unread: false,
notable_tags: NotableTags::empty(),
notable_tags: RoomNotableTags::empty(),
}
}
}

View File

@@ -58,7 +58,7 @@ use tracing::{debug, field::debug, info, instrument, trace, warn};
use super::{
members::{MemberInfo, MemberRoomInfo},
BaseRoomInfo, DisplayName, NotableTags, RoomCreateWithCreatorEventContent, RoomMember,
BaseRoomInfo, DisplayName, RoomCreateWithCreatorEventContent, RoomMember, RoomNotableTags,
};
#[cfg(feature = "experimental-sliding-sync")]
use crate::latest_event::LatestEvent;
@@ -733,11 +733,11 @@ impl Room {
}
pub fn is_favourite(&self) -> bool {
self.inner.read().base_info.notable_tags.contains(NotableTags::FAVOURITE)
self.inner.read().base_info.notable_tags.contains(RoomNotableTags::FAVOURITE)
}
pub fn is_low_priority(&self) -> bool {
self.inner.read().base_info.notable_tags.contains(NotableTags::LOW_PRIORITY)
self.inner.read().base_info.notable_tags.contains(RoomNotableTags::LOW_PRIORITY)
}
/// Get the receipt as an `OwnedEventId` and `Receipt` tuple for the given

View File

@@ -44,7 +44,7 @@ use crate::{
deserialized_responses::SyncOrStrippedState,
rooms::{
normal::{RoomSummary, SyncInfo},
BaseRoomInfo, NotableTags,
BaseRoomInfo, RoomNotableTags,
},
sync::UnreadNotificationsCount,
MinimalStateEvent, OriginalMinimalStateEvent, RoomInfo, RoomState,
@@ -205,7 +205,7 @@ impl BaseRoomInfoV1 {
topic,
rtc_member: BTreeMap::new(),
is_marked_unread: false,
notable_tags: NotableTags::empty(),
notable_tags: RoomNotableTags::empty(),
})
}
}