diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2016-01-23 13:13:34 -0500 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2016-01-23 13:13:44 -0500 |
commit | fc0b422c37f719a350b65e064cde7b506a88052e (patch) | |
tree | 22f05d072d03c343e27c71406c9ca64ac4487b6d /store/sql_channel_store.go | |
parent | 1a0b12313bd0af1724df2fc6260ef284acfc5f93 (diff) | |
download | chat-fc0b422c37f719a350b65e064cde7b506a88052e.tar.gz chat-fc0b422c37f719a350b65e064cde7b506a88052e.tar.bz2 chat-fc0b422c37f719a350b65e064cde7b506a88052e.zip |
Changed GetMemberCount to stop including inactive users
Diffstat (limited to 'store/sql_channel_store.go')
-rw-r--r-- | store/sql_channel_store.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go index 336398ae7..7400df8d2 100644 --- a/store/sql_channel_store.go +++ b/store/sql_channel_store.go @@ -582,7 +582,16 @@ func (s SqlChannelStore) GetMemberCount(channelId string) StoreChannel { go func() { result := StoreResult{} - count, err := s.GetReplica().SelectInt("SELECT count(*) FROM ChannelMembers WHERE ChannelId = :ChannelId", map[string]interface{}{"ChannelId": channelId}) + count, err := s.GetReplica().SelectInt(` + SELECT + count(*) + FROM + ChannelMembers, + Users + WHERE + ChannelMembers.UserId = Users.Id + AND ChannelMembers.ChannelId = :ChannelId + AND Users.DeleteAt = 0`, map[string]interface{}{"ChannelId": channelId}) if err != nil { result.Err = model.NewAppError("SqlChannelStore.GetMemberCount", "We couldn't get the channel member count", "channel_id="+channelId+", "+err.Error()) } else { |