summaryrefslogtreecommitdiffstats
path: root/model/preference.go
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-10-01 10:56:07 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-10-13 09:42:23 -0400
commitda66599fa39ddbff96b0844fabac161e130a2bc4 (patch)
treeda6ba69abdf1fa846805ef8cca3f1449aa6df15f /model/preference.go
parent3229457de0eb6e04fff6ce4fe1466a828be5f6f6 (diff)
downloadchat-da66599fa39ddbff96b0844fabac161e130a2bc4.tar.gz
chat-da66599fa39ddbff96b0844fabac161e130a2bc4.tar.bz2
chat-da66599fa39ddbff96b0844fabac161e130a2bc4.zip
Added Preferences table to store user preferences
Diffstat (limited to 'model/preference.go')
-rw-r--r--model/preference.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/model/preference.go b/model/preference.go
index 900c1d7a0..f363434e3 100644
--- a/model/preference.go
+++ b/model/preference.go
@@ -10,7 +10,9 @@ import (
const (
PREFERENCE_CATEGORY_DIRECT_CHANNELS = "direct_channels"
+ PREFERENCE_CATEGORY_TEST = "test" // do not use, just for testing uniqueness while there's only one real category
PREFERENCE_NAME_SHOWHIDE = "show_hide"
+ PREFERENCE_NAME_TEST = "test" // do not use, just for testing uniqueness while there's only one real name
)
type Preference struct {
@@ -66,9 +68,9 @@ func (o *Preference) IsValid() *AppError {
}
func IsPreferenceCategoryValid(category string) bool {
- return category == PREFERENCE_CATEGORY_DIRECT_CHANNELS
+ return category == PREFERENCE_CATEGORY_DIRECT_CHANNELS || category == PREFERENCE_CATEGORY_TEST
}
func IsPreferenceNameValid(name string) bool {
- return name == PREFERENCE_NAME_SHOWHIDE
+ return name == PREFERENCE_NAME_SHOWHIDE || name == PREFERENCE_NAME_TEST
}