diff options
Diffstat (limited to 'mumd/src/state.rs')
| -rw-r--r-- | mumd/src/state.rs | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/mumd/src/state.rs b/mumd/src/state.rs index 84583e0..a57b53d 100644 --- a/mumd/src/state.rs +++ b/mumd/src/state.rs @@ -687,14 +687,26 @@ pub fn handle_command( for target in targets { match target { + MessageTarget::CurrentChannel { recursive } => { + let channel_id = match state.server().unwrap().current_channel() { + Some(channel)=> channel.0, + None => return now!(Err(Error::NotConnectedToChannel)), + }; + + if recursive { + msg.mut_tree_id() + } else { + msg.mut_channel_id() + } + .push(channel_id); + } MessageTarget::Channel { recursive, name } => { - let channel_id = state.server().unwrap().channel_name(&name); + let channel = state.server().unwrap().channel_name(&name); - let channel_id = match channel_id { - Ok(id) => id, + let channel_id = match channel { + Ok(channel) => channel.0, Err(e) => return now!(Err(Error::ChannelIdentifierError(name, e))), - } - .0; + }; if recursive { msg.mut_tree_id() |
