Skip to content

Commit 4e7c87e

Browse files
committed
Use channels:join permission to just ... join the channel
1 parent a20cb7f commit 4e7c87e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

bridge/slack/slack.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,20 +168,19 @@ func (b *Bslack) JoinChannel(channel config.ChannelInfo) error {
168168
return nil
169169
}
170170

171-
b.channels.populateChannels(true)
171+
b.channels.populateChannels(false)
172172

173173
channelInfo, err := b.channels.getChannel(channel.Name)
174174
if err != nil {
175175
return fmt.Errorf("could not find channel: %#v", err)
176176
}
177177

178-
// we can't join a channel unless we are using legacy tokens #651
178+
// we can join a channel if we have `channels:join` scope
179179
if !channelInfo.IsMember {
180-
b.Log.Infof("Not currently a member of %s. Trying to join by ID (%s)", channel.Name, channelInfo.ID)
181180
// try to join the channel
182181
_, _, _, err := b.sc.JoinConversation(channelInfo.ID)
183182
if err != nil {
184-
return fmt.Errorf("the slack integration that matterbridge is using is not member of channel '%s' (and cannot join), please add it manually. %s", channelInfo.Name, err)
183+
return fmt.Errorf("the slack integration is not member of channel '%s' (and cannot join by ID: %s), please add it manually. %s", channelInfo.Name, channelInfo.ID, err)
185184
}
186185
}
187186

0 commit comments

Comments
 (0)