From 1974db9d719640f5cd5a8b51fa1b97f801f5a809 Mon Sep 17 00:00:00 2001 From: Eskil Queseth Date: Sat, 17 Oct 2020 01:19:45 +0200 Subject: change connecting with channel name instead of id --- mumlib/src/state.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mumlib/src/state.rs') diff --git a/mumlib/src/state.rs b/mumlib/src/state.rs index f90634e..51fb492 100644 --- a/mumlib/src/state.rs +++ b/mumlib/src/state.rs @@ -128,6 +128,13 @@ impl Channel { pub fn name(&self) -> &str { &self.name } + + pub fn path(&self, channels: &HashMap) -> String { + match &self.parent { + Some(t) => format!("{}/{}", channels.get(t).unwrap().path(channels), self.name), + None => self.name.clone(), + } + } } #[derive(Clone, Debug, Deserialize, Serialize)] -- cgit v1.2.1