mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Migrates Status.GetOnline to sync by default (#11351)
* Status.GetOnline to sync by default * Removed else sentence
This commit is contained in:
committed by
Jesús Espino
parent
162a2a9903
commit
0199cef145
@@ -111,15 +111,12 @@ func (s SqlStatusStore) GetOnlineAway() store.StoreChannel {
|
||||
})
|
||||
}
|
||||
|
||||
func (s SqlStatusStore) GetOnline() store.StoreChannel {
|
||||
return store.Do(func(result *store.StoreResult) {
|
||||
var statuses []*model.Status
|
||||
if _, err := s.GetReplica().Select(&statuses, "SELECT * FROM Status WHERE Status = :Online", map[string]interface{}{"Online": model.STATUS_ONLINE}); err != nil {
|
||||
result.Err = model.NewAppError("SqlStatusStore.GetOnline", "store.sql_status.get_online.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
} else {
|
||||
result.Data = statuses
|
||||
}
|
||||
})
|
||||
func (s SqlStatusStore) GetOnline() ([]*model.Status, *model.AppError) {
|
||||
var statuses []*model.Status
|
||||
if _, err := s.GetReplica().Select(&statuses, "SELECT * FROM Status WHERE Status = :Online", map[string]interface{}{"Online": model.STATUS_ONLINE}); err != nil {
|
||||
return nil, model.NewAppError("SqlStatusStore.GetOnline", "store.sql_status.get_online.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
return statuses, nil
|
||||
}
|
||||
|
||||
func (s SqlStatusStore) GetAllFromTeam(teamId string) store.StoreChannel {
|
||||
|
||||
Reference in New Issue
Block a user