diff options
author | Wim <wim@42.be> | 2023-08-05 20:43:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-05 20:43:19 +0200 |
commit | 56e7bd01ca09ad52b0c4f48f146a20a4f1b78696 (patch) | |
tree | b1355645342667209263cbd355dc0b4254f1e8fe /vendor/github.com/mattermost/mattermost-server/v5/model/compliance_post.go | |
parent | 9459495484d6e06a3d46de64fccd8d06f7ccc72c (diff) | |
download | matterbridge-msglm-56e7bd01ca09ad52b0c4f48f146a20a4f1b78696.tar.gz matterbridge-msglm-56e7bd01ca09ad52b0c4f48f146a20a4f1b78696.tar.bz2 matterbridge-msglm-56e7bd01ca09ad52b0c4f48f146a20a4f1b78696.zip |
Diffstat (limited to 'vendor/github.com/mattermost/mattermost-server/v5/model/compliance_post.go')
-rw-r--r-- | vendor/github.com/mattermost/mattermost-server/v5/model/compliance_post.go | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/vendor/github.com/mattermost/mattermost-server/v5/model/compliance_post.go b/vendor/github.com/mattermost/mattermost-server/v5/model/compliance_post.go deleted file mode 100644 index 5e18812b..00000000 --- a/vendor/github.com/mattermost/mattermost-server/v5/model/compliance_post.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. -// See LICENSE.txt for license information. - -package model - -import ( - "regexp" - "time" -) - -type CompliancePost struct { - - // From Team - TeamName string - TeamDisplayName string - - // From Channel - ChannelName string - ChannelDisplayName string - ChannelType string - - // From User - UserUsername string - UserEmail string - UserNickname string - - // From Post - PostId string - PostCreateAt int64 - PostUpdateAt int64 - PostDeleteAt int64 - PostRootId string - PostParentId string - PostOriginalId string - PostMessage string - PostType string - PostProps string - PostHashtags string - PostFileIds string - - IsBot bool -} - -func CompliancePostHeader() []string { - return []string{ - "TeamName", - "TeamDisplayName", - - "ChannelName", - "ChannelDisplayName", - "ChannelType", - - "UserUsername", - "UserEmail", - "UserNickname", - "UserType", - - "PostId", - "PostCreateAt", - "PostUpdateAt", - "PostDeleteAt", - "PostRootId", - "PostParentId", - "PostOriginalId", - "PostMessage", - "PostType", - "PostProps", - "PostHashtags", - "PostFileIds", - } -} - -func cleanComplianceStrings(in string) string { - if matched, _ := regexp.MatchString("^\\s*(=|\\+|\\-)", in); matched { - return "'" + in - } - return in -} - -func (cp *CompliancePost) Row() []string { - - postDeleteAt := "" - if cp.PostDeleteAt > 0 { - postDeleteAt = time.Unix(0, cp.PostDeleteAt*int64(1000*1000)).Format(time.RFC3339) - } - - postUpdateAt := "" - if cp.PostUpdateAt != cp.PostCreateAt { - postUpdateAt = time.Unix(0, cp.PostUpdateAt*int64(1000*1000)).Format(time.RFC3339) - } - - userType := "user" - if cp.IsBot { - userType = "bot" - } - - return []string{ - cleanComplianceStrings(cp.TeamName), - cleanComplianceStrings(cp.TeamDisplayName), - - cleanComplianceStrings(cp.ChannelName), - cleanComplianceStrings(cp.ChannelDisplayName), - cleanComplianceStrings(cp.ChannelType), - - cleanComplianceStrings(cp.UserUsername), - cleanComplianceStrings(cp.UserEmail), - cleanComplianceStrings(cp.UserNickname), - userType, - - cp.PostId, - time.Unix(0, cp.PostCreateAt*int64(1000*1000)).Format(time.RFC3339), - postUpdateAt, - postDeleteAt, - - cp.PostRootId, - cp.PostParentId, - cp.PostOriginalId, - cleanComplianceStrings(cp.PostMessage), - cp.PostType, - cp.PostProps, - cp.PostHashtags, - cp.PostFileIds, - } -} |