chore(base): Move RoomNotificationMode into matrix-sdk-base.

This patch moves the `RoomNotificationMode` type from `matrix-sdk`
to `matrix-sdk-base` because it's going to be shared across multiple
crates.
This commit is contained in:
Ivan Enderlin
2024-08-14 09:16:22 +02:00
committed by Stefan Ceriu
parent 6becbf61c9
commit 7e2c773d21
3 changed files with 29 additions and 11 deletions

View File

@@ -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;

View File

@@ -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,
}

View File

@@ -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 {