diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-01-11 06:54:55 -0500 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-01-11 06:54:55 -0500 |
commit | 7aa7f83524c06b6e0a9ec2274d4ac4744a83bda8 (patch) | |
tree | 55ae148c4336125f76f4aa9ba4731c94d9297811 /store | |
parent | 2d141c29826f31aacad286b63cca61a551c619a8 (diff) | |
parent | d7230e8753c848725ba5b61d11b29b6280fce94b (diff) | |
download | chat-7aa7f83524c06b6e0a9ec2274d4ac4744a83bda8.tar.gz chat-7aa7f83524c06b6e0a9ec2274d4ac4744a83bda8.tar.bz2 chat-7aa7f83524c06b6e0a9ec2274d4ac4744a83bda8.zip |
Merge pull request #1824 from hmhealey/plt1525
PLT-1525 Fixed ChannelInviteModal displaying some users that are already in the channel
Diffstat (limited to 'store')
-rw-r--r-- | store/sql_channel_store.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go index c9e0d113f..4585647de 100644 --- a/store/sql_channel_store.go +++ b/store/sql_channel_store.go @@ -603,7 +603,14 @@ func (s SqlChannelStore) GetExtraMembers(channelId string, limit int) StoreChann result := StoreResult{} var members []model.ExtraMember - _, err := s.GetReplica().Select(&members, "SELECT Id, Nickname, Email, ChannelMembers.Roles, Username FROM ChannelMembers, Users WHERE ChannelMembers.UserId = Users.Id AND ChannelId = :ChannelId LIMIT :Limit", map[string]interface{}{"ChannelId": channelId, "Limit": limit}) + var err error + + if limit != -1 { + _, err = s.GetReplica().Select(&members, "SELECT Id, Nickname, Email, ChannelMembers.Roles, Username FROM ChannelMembers, Users WHERE ChannelMembers.UserId = Users.Id AND ChannelId = :ChannelId LIMIT :Limit", map[string]interface{}{"ChannelId": channelId, "Limit": limit}) + } else { + _, err = s.GetReplica().Select(&members, "SELECT Id, Nickname, Email, ChannelMembers.Roles, Username FROM ChannelMembers, Users WHERE ChannelMembers.UserId = Users.Id AND ChannelId = :ChannelId", map[string]interface{}{"ChannelId": channelId}) + } + if err != nil { result.Err = model.NewAppError("SqlChannelStore.GetExtraMembers", "We couldn't get the extra info for channel members", "channel_id="+channelId+", "+err.Error()) } else { |