PLT-2559 Always return successful when trying to join a channel that the user is already a member of (#3265)
* Added unit tests for SqlChannelStore.GetMember * Fixed api routes for accessing channels by name when the name includes an underscore * Changed join channel API to always return successful when the user is already a member of the channel
Этот коммит содержится в:
@@ -476,6 +476,11 @@ func joinChannel(c *Context, channelChannel store.StoreChannel, userChannel stor
|
||||
channel := cresult.Data.(*model.Channel)
|
||||
user := uresult.Data.(*model.User)
|
||||
|
||||
if mresult := <-Srv.Store.Channel().GetMember(channel.Id, user.Id); mresult.Err == nil && mresult.Data != nil {
|
||||
// the user is already in the channel so just return successful
|
||||
return nil, channel
|
||||
}
|
||||
|
||||
if !c.HasPermissionsToTeam(channel.TeamId, "join") {
|
||||
return c.Err, nil
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user