Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TraqChannelService #94

Merged
merged 9 commits into from
Jan 25, 2025
Prev Previous commit
Next Next commit
パスが"#/"始まりになってしまうのを修正
helgev-traP committed Jan 25, 2025
commit 5c9a5ed4daebac03d64a0c2b43761c8df2dc593a
8 changes: 6 additions & 2 deletions server/src/traq/channel/impl.rs
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ where

Ok(root_channels
.iter()
.flat_map(|node| node.dfs("#", &channels))
.flat_map(|node| node.dfs("", &channels))
.collect::<Vec<_>>())
}

@@ -123,7 +123,11 @@ impl ChannelNode {
channels: &HashMap<super::TraqChannelId, ChannelNode>,
) -> Vec<super::TraqChannel> {
// current channel
let path = format!("{}/{}", path, self.name);
let path = if path == "#" {
format!("#{}", self.name)
} else {
format!("{}/{}", path, self.name)
};

let mut result = vec![super::TraqChannel {
id: self.id,