diff options
Diffstat (limited to 'app/preference.go')
-rw-r--r-- | app/preference.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/preference.go b/app/preference.go new file mode 100644 index 000000000..4e492c4a8 --- /dev/null +++ b/app/preference.go @@ -0,0 +1,16 @@ +// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +package app + +import ( + "github.com/mattermost/platform/model" +) + +func GetPreferencesForUser(userId string) (model.Preferences, *model.AppError) { + if result := <-Srv.Store.Preference().GetAll(userId); result.Err != nil { + return nil, result.Err + } else { + return result.Data.(model.Preferences), nil + } +} |