From c6d63f0b5c231bfc42128a670923a660fabd1835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Mon, 7 Jun 2021 17:58:06 +0200 Subject: default send message to current channel if no channel specified --- mumctl/src/main.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'mumctl/src/main.rs') diff --git a/mumctl/src/main.rs b/mumctl/src/main.rs index bde24a1..7d02582 100644 --- a/mumctl/src/main.rs +++ b/mumctl/src/main.rs @@ -381,10 +381,14 @@ fn match_opt() -> Result<(), Error> { } => { let msg = MumCommand::SendMessage { message, - targets: names - .into_iter() - .map(|name| MessageTarget::Channel { name, recursive }) - .collect(), + targets: if !names.is_empty() { + names + .into_iter() + .map(|name| MessageTarget::Channel { name, recursive }) + .collect() + } else { + vec![MessageTarget::CurrentChannel { recursive }] + }, }; send_command(msg)??; } -- cgit v1.2.1