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 --- mumlib/src/command.rs | 1 + mumlib/src/error.rs | 2 ++ 2 files changed, 3 insertions(+) (limited to 'mumlib/src') diff --git a/mumlib/src/command.rs b/mumlib/src/command.rs index 351d7f6..f8a8fc8 100644 --- a/mumlib/src/command.rs +++ b/mumlib/src/command.rs @@ -69,6 +69,7 @@ pub enum CommandResponse { #[derive(Clone, Debug, Deserialize, Serialize)] pub enum MessageTarget { + CurrentChannel {recursive: bool }, Channel { recursive: bool, name: String }, User { name: String }, } diff --git a/mumlib/src/error.rs b/mumlib/src/error.rs index e88bd97..83f97b8 100644 --- a/mumlib/src/error.rs +++ b/mumlib/src/error.rs @@ -11,6 +11,7 @@ pub enum Error { InvalidServerAddr(String, u16), InvalidUsername(String), InvalidServerPassword, + NotConnectedToChannel, } impl std::error::Error for Error {} @@ -26,6 +27,7 @@ impl fmt::Display for Error { } Error::InvalidUsername(username) => write!(f, "Invalid username: {}", username), Error::InvalidServerPassword => write!(f, "Invalid server password"), + Error::NotConnectedToChannel => write!(f, "Not connected to a channel"), } } } -- cgit v1.2.1