Sanitize post for audit with preview links (#23745)
* sanitize post for audit with preview links * add unit test --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
@@ -120,6 +120,11 @@ type Post struct {
|
||||
}
|
||||
|
||||
func (o *Post) Auditable() map[string]interface{} {
|
||||
var metaData map[string]any
|
||||
if o.Metadata != nil {
|
||||
metaData = o.Metadata.Auditable()
|
||||
}
|
||||
|
||||
return map[string]interface{}{
|
||||
"id": o.Id,
|
||||
"create_at": o.CreateAt,
|
||||
@@ -139,7 +144,7 @@ func (o *Post) Auditable() map[string]interface{} {
|
||||
"reply_count": o.ReplyCount,
|
||||
"last_reply_at": o.LastReplyAt,
|
||||
"is_following": o.IsFollowing,
|
||||
"metadata": o.Metadata,
|
||||
"metadata": metaData,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user