diff options
Diffstat (limited to 'api/channel.go')
-rw-r--r-- | api/channel.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/api/channel.go b/api/channel.go index ba6de1a48..6d1604900 100644 --- a/api/channel.go +++ b/api/channel.go @@ -512,8 +512,15 @@ func AddUserToChannel(user *model.User, channel *model.Channel) (*model.ChannelM return nil, model.NewLocAppError("AddUserToChannel", "api.channel.add_user_to_channel.type.app_error", nil, "") } - if result := <-Srv.Store.Channel().GetMember(channel.Id, user.Id); result.Err != nil { - if result.Err.Id != store.MISSING_MEMBER_ERROR { + tmchan := Srv.Store.Team().GetMember(channel.TeamId, user.Id) + cmchan := Srv.Store.Channel().GetMember(channel.Id, user.Id) + + if result := <-tmchan; result.Err != nil { + return nil, result.Err + } + + if result := <-cmchan; result.Err != nil { + if result.Err.Id != store.MISSING_CHANNEL_MEMBER_ERROR { return nil, result.Err } } else { |