summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-07-07 11:00:29 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-07-07 11:00:29 -0400
commit23e527978ed3e889bebe5c879de2d4835509626a (patch)
tree7534d89f2c8964cba7aa2c21d29dd066de15f6e1 /model
parent3dec509899f60ca0d2eadfcc192ccc49969852ef (diff)
downloadchat-23e527978ed3e889bebe5c879de2d4835509626a.tar.gz
chat-23e527978ed3e889bebe5c879de2d4835509626a.tar.bz2
chat-23e527978ed3e889bebe5c879de2d4835509626a.zip
Add a post type for user joined/left messages and don't flag a channel as unread when one of those is automatically posted
Diffstat (limited to 'model')
-rw-r--r--model/post.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/model/post.go b/model/post.go
index d10a9f9fc..f6f33b1e8 100644
--- a/model/post.go
+++ b/model/post.go
@@ -9,7 +9,8 @@ import (
)
const (
- POST_DEFAULT = ""
+ POST_DEFAULT = ""
+ POST_JOIN_LEAVE = "join_leave"
)
type Post struct {
@@ -100,7 +101,7 @@ func (o *Post) IsValid() *AppError {
return NewAppError("Post.IsValid", "Invalid hashtags", "id="+o.Id)
}
- if !(o.Type == POST_DEFAULT) {
+ if !(o.Type == POST_DEFAULT || o.Type == POST_JOIN_LEAVE) {
return NewAppError("Post.IsValid", "Invalid type", "id="+o.Type)
}