From 3a37de494e3f19470ed1c0d5d33d2716684dfb5e Mon Sep 17 00:00:00 2001 From: Haw Loeung Date: Wed, 2 Nov 2022 09:30:18 +1100 Subject: [PATCH] Fix joining channels --- .../matterbridge/matterclient/channels.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/vendor/github.com/matterbridge/matterclient/channels.go b/vendor/github.com/matterbridge/matterclient/channels.go index 6bf22a68..e85bfa80 100644 --- a/vendor/github.com/matterbridge/matterclient/channels.go +++ b/vendor/github.com/matterbridge/matterclient/channels.go @@ -70,17 +70,11 @@ func (m *Client) GetChannelID(name string, teamID string) string { } func (m *Client) getChannelIDTeam(name string, teamID string) string { - for _, t := range m.OtherTeams { - if t.ID == teamID { - for _, channel := range append(t.Channels, t.MoreChannels...) { - if getNormalisedName(channel) == name { - return channel.Id - } - } - } + channel, resp, err := m.Client.GetChannelByName(name, teamID, "") + if err != nil || resp == nil { + return "" } - - return "" + return channel.Id } func (m *Client) GetChannelName(channelID string) string {