summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorSimone Salsi <thedos@terminus.space>2018-10-08 18:01:27 +0200
committerGeorge Goldberg <george@gberg.me>2018-10-08 17:01:27 +0100
commitfe9a81208e4d8290df7b8d89bac2d880c045b84b (patch)
tree79db085e0447214d18dd145ec99eb67c50ff61c1 /model
parent9a4f3ce1e5b22a297eeb00b2aaff44f88304ae8c (diff)
downloadchat-fe9a81208e4d8290df7b8d89bac2d880c045b84b.tar.gz
chat-fe9a81208e4d8290df7b8d89bac2d880c045b84b.tar.bz2
chat-fe9a81208e4d8290df7b8d89bac2d880c045b84b.zip
Added the changes requested for MM-8860: Bulk import email intervals (#8498) (#9578)
MM-8860: Bulk import email intervals (#8498)
Diffstat (limited to 'model')
-rw-r--r--model/preference.go5
-rw-r--r--model/user.go6
2 files changed, 11 insertions, 0 deletions
diff --git a/model/preference.go b/model/preference.go
index 6f13c38e5..05379b90a 100644
--- a/model/preference.go
+++ b/model/preference.go
@@ -42,6 +42,11 @@ const (
PREFERENCE_EMAIL_INTERVAL_NO_BATCHING_SECONDS = "30" // the "immediate" setting is actually 30s
PREFERENCE_EMAIL_INTERVAL_BATCHING_SECONDS = "900" // fifteen minutes is 900 seconds
+ PREFERENCE_EMAIL_INTERVAL_IMMEDIATELY = "immediately"
+ PREFERENCE_EMAIL_INTERVAL_FIFTEEN = "fifteen"
+ PREFERENCE_EMAIL_INTERVAL_FIFTEEN_AS_SECONDS = "900"
+ PREFERENCE_EMAIL_INTERVAL_HOUR = "hour"
+ PREFERENCE_EMAIL_INTERVAL_HOUR_AS_SECONDS = "3600"
)
type Preference struct {
diff --git a/model/user.go b/model/user.go
index 2b5092cfb..d94a28b2d 100644
--- a/model/user.go
+++ b/model/user.go
@@ -639,3 +639,9 @@ func IsValidCommentsNotifyLevel(notifyLevel string) bool {
notifyLevel == COMMENTS_NOTIFY_ROOT ||
notifyLevel == COMMENTS_NOTIFY_NEVER
}
+
+func IsValidEmailBatchingInterval(emailInterval string) bool {
+ return emailInterval == PREFERENCE_EMAIL_INTERVAL_IMMEDIATELY ||
+ emailInterval == PREFERENCE_EMAIL_INTERVAL_FIFTEEN ||
+ emailInterval == PREFERENCE_EMAIL_INTERVAL_HOUR
+}