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 --- mumd/src/state/server.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mumd/src/state/server.rs') diff --git a/mumd/src/state/server.rs b/mumd/src/state/server.rs index 869940a..58c614c 100644 --- a/mumd/src/state/server.rs +++ b/mumd/src/state/server.rs @@ -132,6 +132,12 @@ impl Server { }) } + pub fn current_channel(&self) -> Option<(u32, &Channel)> { + let channel_id = self.users().get(&self.session_id()?)?.channel(); + let channel = self.channels().get(&channel_id)?; + Some((channel_id, channel)) + } + pub fn host_mut(&mut self) -> &mut Option { &mut self.host } -- cgit v1.2.1