Indicator

This commit is contained in:
2026-01-09 21:25:16 +01:00
parent 857fb9cadb
commit b18623bf3e
+14 -1
View File
@@ -1,6 +1,19 @@
use crate::{server::Server, utils::client::Client}; use crate::{requests::indicator::IndicatorContext, server::Server, types, utils::client::Client};
use std::sync::Arc; use std::sync::Arc;
pub fn start_typing(server: &Arc<Server>, client: &Client, channel_id: &str) -> crate::Result<()> { pub fn start_typing(server: &Arc<Server>, client: &Client, channel_id: &str) -> crate::Result<()> {
let user_id = client.get_uuid()?;
server.broadcast_to(
&[&user_id.clone(), &channel_id.to_string()],
types::message::ServerMessage::Indicator(IndicatorContext {
indicator: crate::requests::indicator::Indicator::Typing {
user_id,
channel_id: channel_id.to_string(),
},
expires: 2, // 2 secs
}),
)?;
Ok(()) Ok(())
} }