Add a post type for user joined/left messages and don't flag a channel as unread when one of those is automatically posted

Этот коммит содержится в:
hmhealey
2015-07-07 11:00:29 -04:00
родитель 3dec509899
Коммит 23e527978e
3 изменённых файлов: 15 добавлений и 8 удалений

Просмотреть файл

@@ -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)
}