PLT-3921 Fix System Console Recent Active Users (#3856)

* PLT-3921 System Console Recent Active Users
Этот коммит содержится в:
enahum
2016-09-06 15:48:43 -03:00
коммит произвёл GitHub
родитель 9a9ae3dcd1
Коммит 35b816b922
9 изменённых файлов: 99 добавлений и 1 удалений

Просмотреть файл

@@ -129,6 +129,28 @@ func (s SqlStatusStore) GetOnline() StoreChannel {
return storeChannel
}
func (s SqlStatusStore) GetAllFromTeam(teamId string) StoreChannel {
storeChannel := make(StoreChannel)
go func() {
result := StoreResult{}
var statuses []*model.Status
if _, err := s.GetReplica().Select(&statuses,
`SELECT s.* FROM Status AS s INNER JOIN
TeamMembers AS tm ON tm.TeamId=:TeamId AND s.UserId=tm.UserId`, map[string]interface{}{"TeamId": teamId}); err != nil {
result.Err = model.NewLocAppError("SqlStatusStore.GetAllFromTeam", "store.sql_status.get_team_statuses.app_error", nil, err.Error())
} else {
result.Data = statuses
}
storeChannel <- result
close(storeChannel)
}()
return storeChannel
}
func (s SqlStatusStore) ResetAll() StoreChannel {
storeChannel := make(StoreChannel)

Просмотреть файл

@@ -275,6 +275,7 @@ type StatusStore interface {
Get(userId string) StoreChannel
GetOnlineAway() StoreChannel
GetOnline() StoreChannel
GetAllFromTeam(teamId string) StoreChannel
ResetAll() StoreChannel
GetTotalActiveUsersCount() StoreChannel
UpdateLastActivityAt(userId string, lastActivityAt int64) StoreChannel