mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-09-11 07:33:01 +02:00
feat: Suspend new users on registration
This commit is contained in:
parent
68afb07c27
commit
6e60918584
4 changed files with 57 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue