mirror of
https://github.com/mattermost/mattermost.git
synced 2026-05-28 04:35:04 -04:00
[MM-61101] Fix errcheck issues in server/channels/app/channel.go (#28787)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
This commit is contained in:
parent
3ad2c9e666
commit
aa0d117f30
2 changed files with 9 additions and 5 deletions
|
|
@ -83,7 +83,6 @@ issues:
|
|||
channels/api4/websocket_test.go|\
|
||||
channels/app/bot_test.go|\
|
||||
channels/app/brand.go|\
|
||||
channels/app/channel.go|\
|
||||
channels/app/channel_bookmark_test.go|\
|
||||
channels/app/channel_test.go|\
|
||||
channels/app/config_test.go|\
|
||||
|
|
|
|||
|
|
@ -186,7 +186,9 @@ func (a *App) CreateChannelWithUser(c request.CTX, channel *model.Channel, userI
|
|||
return nil, err
|
||||
}
|
||||
|
||||
a.postJoinChannelMessage(c, user, channel)
|
||||
if err = a.postJoinChannelMessage(c, user, channel); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
message := model.NewWebSocketEvent(model.WebsocketEventChannelCreated, "", "", userID, nil, "")
|
||||
message.Add("channel_id", channel.Id)
|
||||
|
|
@ -710,15 +712,18 @@ func (a *App) UpdateChannelPrivacy(c request.CTX, oldChannel *model.Channel, use
|
|||
return channel, err
|
||||
}
|
||||
|
||||
if err := a.postChannelPrivacyMessage(c, user, channel); err != nil {
|
||||
postErr := a.postChannelPrivacyMessage(c, user, channel)
|
||||
if postErr != nil {
|
||||
if channel.Type == model.ChannelTypeOpen {
|
||||
channel.Type = model.ChannelTypePrivate
|
||||
} else {
|
||||
channel.Type = model.ChannelTypeOpen
|
||||
}
|
||||
// revert to previous channel privacy
|
||||
a.UpdateChannel(c, channel)
|
||||
return channel, err
|
||||
if _, err = a.UpdateChannel(c, channel); err != nil {
|
||||
a.Log().Error("Failed to revert channel privacy after posting an update message failed", mlog.Err(err))
|
||||
}
|
||||
return channel, postErr
|
||||
}
|
||||
|
||||
a.Srv().Platform().InvalidateCacheForChannel(channel)
|
||||
|
|
|
|||
Loading…
Reference in a new issue