diff options
author | Chris <ccbrown112@gmail.com> | 2018-02-12 12:02:54 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-12 12:02:54 -0600 |
commit | 1ae680aefae2deb1e9d07d7c2a1c863ec807a79f (patch) | |
tree | a99a74d6b858d73624c06f85e393acbe97c90586 /model/post.go | |
parent | 9707ac3aaf2cb4352c573aadf54b8535e237dd9e (diff) | |
parent | 07fd7aeeb8eb2b198b01b713a4ab57f6352faef2 (diff) | |
download | chat-1ae680aefae2deb1e9d07d7c2a1c863ec807a79f.tar.gz chat-1ae680aefae2deb1e9d07d7c2a1c863ec807a79f.tar.bz2 chat-1ae680aefae2deb1e9d07d7c2a1c863ec807a79f.zip |
Merge branch 'master' into release-4.7
Diffstat (limited to 'model/post.go')
-rw-r--r-- | model/post.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/model/post.go b/model/post.go index 391b948f4..4a774b5d4 100644 --- a/model/post.go +++ b/model/post.go @@ -28,6 +28,7 @@ const ( 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_MOVE_CHANNEL = "system_move_channel" POST_ADD_TO_TEAM = "system_add_to_team" POST_REMOVE_FROM_TEAM = "system_remove_from_team" POST_HEADER_CHANGE = "system_header_change" @@ -121,12 +122,13 @@ type PostActionIntegrationResponse struct { func (o *Post) ToJson() string { copy := *o copy.StripActionIntegrations() - b, err := json.Marshal(©) - if err != nil { - return "" - } else { - return string(b) - } + b, _ := json.Marshal(©) + return string(b) +} + +func (o *Post) ToUnsanitizedJson() string { + b, _ := json.Marshal(o) + return string(b) } func PostFromJson(data io.Reader) *Post { @@ -196,6 +198,7 @@ func (o *Post) IsValid() *AppError { POST_LEAVE_TEAM, POST_ADD_TO_CHANNEL, POST_REMOVE_FROM_CHANNEL, + POST_MOVE_CHANNEL, POST_ADD_TO_TEAM, POST_REMOVE_FROM_TEAM, POST_SLACK_ATTACHMENT, |