Fix golangci-lint complaints, #2
This commit is contained in:
parent
64ff9609af
commit
dc6f2fb50c
@ -33,7 +33,9 @@ func (b *Bmumble) handleConnect(event *gumble.ConnectEvent) {
|
|||||||
event.Client.Self.SetSelfMuted(true)
|
event.Client.Self.SetSelfMuted(true)
|
||||||
// if the Channel variable is set, this is a reconnect -> rejoin channel
|
// if the Channel variable is set, this is a reconnect -> rejoin channel
|
||||||
if b.Channel != "" {
|
if b.Channel != "" {
|
||||||
b.doJoin(event.Client, b.Channel)
|
if err := b.doJoin(event.Client, b.Channel); err != nil {
|
||||||
|
b.Log.Error(err)
|
||||||
|
}
|
||||||
b.Remote <- config.Message{
|
b.Remote <- config.Message{
|
||||||
Username: "system",
|
Username: "system",
|
||||||
Text: "rejoin",
|
Text: "rejoin",
|
||||||
@ -51,7 +53,9 @@ func (b *Bmumble) handleUserChange(event *gumble.UserChangeEvent) {
|
|||||||
}
|
}
|
||||||
// Someone attempted to move the user out of the configured channel; attempt to join back
|
// Someone attempted to move the user out of the configured channel; attempt to join back
|
||||||
if b.Channel != "" && b.Channel != event.Client.Self.Channel.Name {
|
if b.Channel != "" && b.Channel != event.Client.Self.Channel.Name {
|
||||||
b.doJoin(event.Client, b.Channel)
|
if err := b.doJoin(event.Client, b.Channel); err != nil {
|
||||||
|
b.Log.Error(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,14 +71,13 @@ func (b *Bmumble) Connect() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *Bmumble) Disconnect() error {
|
func (b *Bmumble) Disconnect() error {
|
||||||
b.client.Disconnect()
|
return b.client.Disconnect()
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Bmumble) JoinChannel(channel config.ChannelInfo) error {
|
func (b *Bmumble) JoinChannel(channel config.ChannelInfo) error {
|
||||||
if b.Channel != "" && channel.Name != b.Channel {
|
if b.Channel != "" && channel.Name != b.Channel {
|
||||||
b.Log.Fatalf("Cannot join channel '%s', already joined to channel '%s'", channel.Name, b.Channel)
|
b.Log.Fatalf("Cannot join channel '%s', already joined to channel '%s'", channel.Name, b.Channel)
|
||||||
return errors.New("The Mumble bridge can only join a single channel")
|
return errors.New("the Mumble bridge can only join a single channel")
|
||||||
}
|
}
|
||||||
b.Channel = channel.Name
|
b.Channel = channel.Name
|
||||||
return b.doJoin(b.client, channel.Name)
|
return b.doJoin(b.client, channel.Name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user