summaryrefslogtreecommitdiffstats
path: root/model/post.go
diff options
context:
space:
mode:
authorFlorian Orben <florian.orben@gmail.com>2015-12-04 02:07:47 +0100
committerFlorian Orben <florian.orben@gmail.com>2015-12-04 02:07:47 +0100
commit14d1ec5191867174837e15f616ad3fc1dc8e0dae (patch)
treecc74c752199a42b3e273570586eb5abd3bc41581 /model/post.go
parentd5d66214db6c108eb94cf2e43c0c4538cdb5d7ae (diff)
downloadchat-14d1ec5191867174837e15f616ad3fc1dc8e0dae.tar.gz
chat-14d1ec5191867174837e15f616ad3fc1dc8e0dae.tar.bz2
chat-14d1ec5191867174837e15f616ad3fc1dc8e0dae.zip
PLT-1326: Enable channel posts of type join or leave not trigger unread notifications
Diffstat (limited to 'model/post.go')
-rw-r--r--model/post.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/model/post.go b/model/post.go
index e66009dd6..2c90d8b7b 100644
--- a/model/post.go
+++ b/model/post.go
@@ -10,9 +10,10 @@ import (
)
const (
- POST_DEFAULT = ""
- POST_SLACK_ATTACHMENT = "slack_attachment"
- POST_JOIN_LEAVE = "join_leave"
+ POST_SYSTEM_MESSAGE_PREFIX = "system_"
+ POST_DEFAULT = ""
+ POST_SLACK_ATTACHMENT = "slack_attachment"
+ POST_JOIN_LEAVE = "system_join_leave"
)
type Post struct {
@@ -159,3 +160,7 @@ func (o *Post) AddProp(key string, value interface{}) {
func (o *Post) PreExport() {
}
+
+func (o *Post) IsSystemMessage() bool {
+ return len(o.Type) >= len(POST_SYSTEM_MESSAGE_PREFIX) && o.Type[:len(POST_SYSTEM_MESSAGE_PREFIX)] == POST_SYSTEM_MESSAGE_PREFIX
+}