Add poke to client messaging
All checks were successful
/ build-upload (push) Successful in 1m37s

This commit is contained in:
Tobias Reisinger 2025-10-25 19:06:15 +02:00
parent b753bb235d
commit 71ab3b52ec
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
8 changed files with 36 additions and 10 deletions

View file

@ -166,6 +166,15 @@ pub fn update_client(connection: &mut Telnet, parameters: ParameterList) -> Resu
commands::clientupdate(connection, parameters)
}
pub fn send_text_message(connection: &mut Telnet, target: SendTextMessageTarget, msg: String) -> Result<Response, String> {
commands::sendtextmessage(connection, target, msg)
}
pub fn send_text_message(connection: &mut Telnet, target: SendTextMessageTarget, msg: String, poke: bool) -> Result<Response, String> {
if poke {
if let SendTextMessageTarget::Client(client) = target {
return commands::clientpoke(connection, client.clid, msg);
} else {
return Err(String::from("Poke can only be sent to clients."));
}
}
else {
commands::sendtextmessage(connection, target, msg)
}
}