mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-28 05:32:01 -08:00
Fix joining slack/mattermost channels using the webhook
This commit is contained in:
parent
d02a737e0c
commit
dce600ad51
@ -84,7 +84,11 @@ func (b *Bmattermost) FullOrigin() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *Bmattermost) JoinChannel(channel string) error {
|
func (b *Bmattermost) JoinChannel(channel string) error {
|
||||||
|
// we can only join channels using the API
|
||||||
|
if b.Config.UseAPI {
|
||||||
return b.mc.JoinChannel(channel)
|
return b.mc.JoinChannel(channel)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Bmattermost) Name() string {
|
func (b *Bmattermost) Name() string {
|
||||||
|
@ -68,9 +68,13 @@ func (b *Bslack) FullOrigin() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *Bslack) JoinChannel(channel string) error {
|
func (b *Bslack) JoinChannel(channel string) error {
|
||||||
|
// we can only join channels using the API
|
||||||
|
if b.Config.UseAPI {
|
||||||
schannel := b.getChannelByName(channel)
|
schannel := b.getChannelByName(channel)
|
||||||
if schannel != nil && !schannel.IsMember {
|
if schannel != nil && !schannel.IsMember {
|
||||||
b.sc.JoinChannel(schannel.ID)
|
_, err := b.sc.JoinChannel(schannel.ID)
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user