diff options
author | Duco van Amstel <helcaraxan@gmail.com> | 2019-05-27 17:38:31 +0100 |
---|---|---|
committer | Duco van Amstel <helcaraxan@gmail.com> | 2019-05-27 17:38:31 +0100 |
commit | 9619dff33417548a50e51a4f75f41b9de4a73327 (patch) | |
tree | bf60db76e088353ca1a3608217dd6810fd706cd1 /matterclient | |
parent | 1b2feb19e506bc24580d5d61422d0de68349c24e (diff) | |
download | matterbridge-msglm-9619dff33417548a50e51a4f75f41b9de4a73327.tar.gz matterbridge-msglm-9619dff33417548a50e51a4f75f41b9de4a73327.tar.bz2 matterbridge-msglm-9619dff33417548a50e51a4f75f41b9de4a73327.zip |
Linter fixes
Diffstat (limited to 'matterclient')
-rw-r--r-- | matterclient/channels.go | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/matterclient/channels.go b/matterclient/channels.go index c09a170f..ae1bf384 100644 --- a/matterclient/channels.go +++ b/matterclient/channels.go @@ -167,25 +167,25 @@ func (m *MMClient) JoinChannel(channelId string) error { //nolint:golint return nil } -func (m *MMClient) UpdateChannelsTeam(teamId string) error { - mmchannels, resp := m.Client.GetChannelsForTeamForUser(teamId, m.User.Id, "") +func (m *MMClient) UpdateChannelsTeam(teamID string) error { + mmchannels, resp := m.Client.GetChannelsForTeamForUser(teamID, m.User.Id, "") if resp.Error != nil { return errors.New(resp.Error.DetailedError) } for idx, t := range m.OtherTeams { - if t.Id == teamId { + if t.Id == teamID { m.Lock() m.OtherTeams[idx].Channels = mmchannels m.Unlock() } } - mmchannels, resp = m.Client.GetPublicChannelsForTeam(teamId, 0, 5000, "") + mmchannels, resp = m.Client.GetPublicChannelsForTeam(teamID, 0, 5000, "") if resp.Error != nil { return errors.New(resp.Error.DetailedError) } for idx, t := range m.OtherTeams { - if t.Id == teamId { + if t.Id == teamID { m.Lock() m.OtherTeams[idx].MoreChannels = mmchannels m.Unlock() @@ -195,9 +195,13 @@ func (m *MMClient) UpdateChannelsTeam(teamId string) error { } func (m *MMClient) UpdateChannels() error { - m.UpdateChannelsTeam(m.Team.Id) + if err := m.UpdateChannelsTeam(m.Team.Id); err != nil { + return err + } for _, t := range m.OtherTeams { - m.UpdateChannelsTeam(t.Id) + if err := m.UpdateChannelsTeam(t.Id); err != nil { + return err + } } return nil } |