diff options
Diffstat (limited to 'model/post.go')
-rw-r--r-- | model/post.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/model/post.go b/model/post.go index 523a97c73..a5ae0b82a 100644 --- a/model/post.go +++ b/model/post.go @@ -33,6 +33,7 @@ const ( POST_MESSAGE_MAX_RUNES = 4000 POST_PROPS_MAX_RUNES = 8000 POST_CUSTOM_TYPE_PREFIX = "custom_" + PROPS_ADD_CHANNEL_MEMBER = "add_channel_member" ) type Post struct { @@ -188,6 +189,18 @@ func (o *Post) IsValid() *AppError { return nil } +func (o *Post) SanitizeProps() { + membersToSanitize := []string{ + PROPS_ADD_CHANNEL_MEMBER, + } + + for _, member := range membersToSanitize { + if _, ok := o.Props[member]; ok { + delete(o.Props, member) + } + } +} + func (o *Post) PreSave() { if o.Id == "" { o.Id = NewId() |