summaryrefslogtreecommitdiffstats
path: root/model/post.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-01-27 15:58:50 -0500
committerGitHub <noreply@github.com>2017-01-27 15:58:50 -0500
commit65b76c2712eea4daa1633e4652fa3cd51037e854 (patch)
tree66306b5bd44ae7a4df4a7121fe85b9887cff160e /model/post.go
parent097289f8e473c799ee752aa56e08f605110f5217 (diff)
downloadchat-65b76c2712eea4daa1633e4652fa3cd51037e854.tar.gz
chat-65b76c2712eea4daa1633e4652fa3cd51037e854.tar.bz2
chat-65b76c2712eea4daa1633e4652fa3cd51037e854.zip
PLT-5225 Added separate post types for certain system messages (#5193)
* Added separate post types for system_join_leave and system_add_remove posts * Added username prop to channel deleted posts * Changed slack import to properly generate the new join/leave messages * Added username prop to channel update posts * Moved Post(AddTo/RemoveFrom)ChanneMessage into app package
Diffstat (limited to 'model/post.go')
-rw-r--r--model/post.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/model/post.go b/model/post.go
index 668c4db61..a7729e0c4 100644
--- a/model/post.go
+++ b/model/post.go
@@ -14,8 +14,12 @@ const (
POST_DEFAULT = ""
POST_SLACK_ATTACHMENT = "slack_attachment"
POST_SYSTEM_GENERIC = "system_generic"
- POST_JOIN_LEAVE = "system_join_leave"
- POST_ADD_REMOVE = "system_add_remove"
+ POST_JOIN_LEAVE = "system_join_leave" // Deprecated, use POST_JOIN_CHANNEL or POST_LEAVE_CHANNEL instead
+ POST_JOIN_CHANNEL = "system_join_channel"
+ POST_LEAVE_CHANNEL = "system_leave_channel"
+ POST_ADD_REMOVE = "system_add_remove" // Deprecated, use POST_ADD_TO_CHANNEL or POST_REMOVE_FROM_CHANNEL instead
+ POST_ADD_TO_CHANNEL = "system_add_to_channel"
+ POST_REMOVE_FROM_CHANNEL = "system_remove_from_channel"
POST_HEADER_CHANGE = "system_header_change"
POST_DISPLAYNAME_CHANGE = "system_displayname_change"
POST_PURPOSE_CHANGE = "system_purpose_change"
@@ -121,6 +125,8 @@ func (o *Post) IsValid() *AppError {
// should be removed once more message types are supported
if !(o.Type == POST_DEFAULT || o.Type == POST_JOIN_LEAVE || o.Type == POST_ADD_REMOVE ||
+ o.Type == POST_JOIN_CHANNEL || o.Type == POST_LEAVE_CHANNEL ||
+ o.Type == POST_REMOVE_FROM_CHANNEL || o.Type == POST_ADD_TO_CHANNEL ||
o.Type == POST_SLACK_ATTACHMENT || o.Type == POST_HEADER_CHANGE || o.Type == POST_PURPOSE_CHANGE ||
o.Type == POST_DISPLAYNAME_CHANGE || o.Type == POST_CHANNEL_DELETED) {
return NewLocAppError("Post.IsValid", "model.post.is_valid.type.app_error", nil, "id="+o.Type)