From 86b9c8d3a7df1a69fbaabab0cf788c1764c0f019 Mon Sep 17 00:00:00 2001 From: user0-07161 Date: Fri, 26 Dec 2025 21:57:32 +0100 Subject: [PATCH] feat: ignore who for now, implement it later --- src/commands/mod.rs | 3 +++ src/commands/who.rs | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/commands/who.rs diff --git a/src/commands/mod.rs b/src/commands/mod.rs index af2a500..a1bf566 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -9,6 +9,7 @@ use crate::{ channels::Channel, commands::{ cap::Cap, join::Join, nick::Nick, ping::Ping, privmsg::PrivMsg, user::User as UserHandler, + who::Who, }, error_structs::CommandExecError, messages::{JoinMessage, Message}, @@ -22,6 +23,7 @@ mod nick; mod ping; mod privmsg; mod user; +mod who; #[derive(Debug)] pub struct IrcCommand { @@ -103,6 +105,7 @@ impl IrcCommand { command_map.insert("PRIVMSG".to_owned(), &PrivMsg); command_map.insert("PING".to_owned(), &Ping); command_map.insert("JOIN".to_owned(), &Join); + command_map.insert("WHO".to_owned(), &Who); println!("{self:#?}"); diff --git a/src/commands/who.rs b/src/commands/who.rs new file mode 100644 index 0000000..2636d52 --- /dev/null +++ b/src/commands/who.rs @@ -0,0 +1,20 @@ +use async_trait::async_trait; + +use crate::{ + commands::{IrcAction, IrcHandler}, + user::User, +}; + +pub struct Who; + +#[async_trait] +impl IrcHandler for Who { + async fn handle( + &self, + _arguments: Vec, + _authenticated: bool, + _user_state: &mut User, + ) -> super::IrcAction { + IrcAction::DoNothing // TODO + } +}