4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-09-18 20:52:29 +00:00
Files
.github
bridge
contrib
docker
gateway
hook
img
internal
matterclient
matterhook
vendor
github.com
go.uber.org
golang.org
gomod.garykim.dev
google.golang.org
gopkg.in
layeh.com
gumble
gumble
gumbleutil
acl.go
bitrate.go
channel.go
doc.go
listener.go
listenerfunc.go
main.go
textmessage.go
LICENSE
modules.txt
.dockerignore
.fixmie.yml
.gitignore
.golangci.yaml
.goreleaser.yml
Dockerfile
LICENSE
README.md
changelog.md
go.mod
go.sum
matterbridge.go
matterbridge.toml.sample
matterbridge.toml.simple
tgs.Dockerfile
matterbridge/vendor/layeh.com/gumble/gumbleutil/channel.go
2020-10-01 22:50:56 +02:00

19 lines
467 B
Go

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
}