summaryrefslogtreecommitdiffstats
path: root/vendor/layeh.com/gumble/gumbleutil/channel.go
diff options
context:
space:
mode:
authorSebastian P <5564491+s3lph@users.noreply.github.com>2020-10-01 22:50:56 +0200
committerGitHub <noreply@github.com>2020-10-01 22:50:56 +0200
commit214a6a13861b9fd495797386f36507373728e577 (patch)
treea2eb9541924b432ecf7a0807f42281296fa144a4 /vendor/layeh.com/gumble/gumbleutil/channel.go
parente7781dc79c0c556f60eb64a93a95a5da494dcf2d (diff)
downloadmatterbridge-msglm-214a6a13861b9fd495797386f36507373728e577.tar.gz
matterbridge-msglm-214a6a13861b9fd495797386f36507373728e577.tar.bz2
matterbridge-msglm-214a6a13861b9fd495797386f36507373728e577.zip
Add Mumble support (#1245)
Diffstat (limited to 'vendor/layeh.com/gumble/gumbleutil/channel.go')
-rw-r--r--vendor/layeh.com/gumble/gumbleutil/channel.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/vendor/layeh.com/gumble/gumbleutil/channel.go b/vendor/layeh.com/gumble/gumbleutil/channel.go
new file mode 100644
index 00000000..ecf8bbef
--- /dev/null
+++ b/vendor/layeh.com/gumble/gumbleutil/channel.go
@@ -0,0 +1,18 @@
+package gumbleutil
+
+import (
+ "layeh.com/gumble/gumble"
+)
+
+// ChannelPath returns a slice of channel names, starting from the root channel
+// to the given channel.
+func ChannelPath(channel *gumble.Channel) []string {
+ var pieces []string
+ for ; channel != nil; channel = channel.Parent {
+ pieces = append(pieces, channel.Name)
+ }
+ for i := 0; i < (len(pieces) / 2); i++ {
+ pieces[len(pieces)-1-i], pieces[i] = pieces[i], pieces[len(pieces)-1-i]
+ }
+ return pieces
+}