feat: Suspend new users on registration

This commit is contained in:
nexy7574 2025-07-02 00:41:34 +01:00 committed by Ellis Git
commit 6e60918584
4 changed files with 57 additions and 1 deletions

View file

@ -18,7 +18,10 @@ use futures::{FutureExt, TryFutureExt};
use loole::{Receiver, Sender};
use ruma::{
OwnedEventId, OwnedRoomId, RoomId, UserId,
events::room::message::{Relation, RoomMessageEventContent},
events::{
Mentions,
room::message::{Relation, RoomMessageEventContent},
},
};
use tokio::sync::RwLock;
@ -158,6 +161,17 @@ impl Service {
.await
}
/// Sends a message, the same as send_message() but with an @room ping to
/// notify all users in the room.
pub async fn send_loud_message(
&self,
mut message_content: RoomMessageEventContent,
) -> Result<()> {
// Add @room ping
message_content = message_content.add_mentions(Mentions::with_room_mention());
self.send_message(message_content).await
}
/// Posts a command to the command processor queue and returns. Processing
/// will take place on the service worker's task asynchronously. Errors if
/// the queue is full.