diff --git a/crates/matrix-sdk-base/src/lib.rs b/crates/matrix-sdk-base/src/lib.rs index 1331c9517..570012978 100644 --- a/crates/matrix-sdk-base/src/lib.rs +++ b/crates/matrix-sdk-base/src/lib.rs @@ -29,6 +29,7 @@ pub mod deserialized_responses; mod error; pub mod latest_event; pub mod media; +pub mod notification_settings; mod rooms; pub mod read_receipts; diff --git a/crates/matrix-sdk-base/src/notification_settings.rs b/crates/matrix-sdk-base/src/notification_settings.rs new file mode 100644 index 000000000..f495a0a3c --- /dev/null +++ b/crates/matrix-sdk-base/src/notification_settings.rs @@ -0,0 +1,26 @@ +// Copyright 2024 The Matrix.org Foundation C.I.C. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for that specific language governing permissions and +// limitations under the License. + +//! Some shared types about notification settings. + +/// Enum representing the push notification modes for a room. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum RoomNotificationMode { + /// Receive notifications for all messages. + AllMessages, + /// Receive notifications for mentions and keywords only. + MentionsAndKeywordsOnly, + /// Do not receive any notifications. + Mute, +} diff --git a/crates/matrix-sdk/src/notification_settings/mod.rs b/crates/matrix-sdk/src/notification_settings/mod.rs index 6fd5d1c11..201f3476e 100644 --- a/crates/matrix-sdk/src/notification_settings/mod.rs +++ b/crates/matrix-sdk/src/notification_settings/mod.rs @@ -23,22 +23,13 @@ mod command; mod rule_commands; mod rules; +pub use matrix_sdk_base::notification_settings::RoomNotificationMode; + use crate::{ config::RequestConfig, error::NotificationSettingsError, event_handler::EventHandlerDropGuard, Client, Result, }; -/// Enum representing the push notification modes for a room. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum RoomNotificationMode { - /// Receive notifications for all messages. - AllMessages, - /// Receive notifications for mentions and keywords only. - MentionsAndKeywordsOnly, - /// Do not receive any notifications. - Mute, -} - /// Whether or not a room is encrypted #[derive(Debug, Clone, Copy)] pub enum IsEncrypted {