diff options
author | Wim <wim@42.be> | 2021-10-17 00:47:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-17 00:47:22 +0200 |
commit | 4dd8bae5c91fa4aef09d865d8fef1acd84f90925 (patch) | |
tree | ffad9b242daccaf8c86d1c1fbd59032302bd3be9 /vendor/github.com/mattermost/mattermost-server/v5/model/compliance.go | |
parent | 7ae45c42e712bd0e66c101f3f714c05aa1dc2104 (diff) | |
download | matterbridge-msglm-4dd8bae5c91fa4aef09d865d8fef1acd84f90925.tar.gz matterbridge-msglm-4dd8bae5c91fa4aef09d865d8fef1acd84f90925.tar.bz2 matterbridge-msglm-4dd8bae5c91fa4aef09d865d8fef1acd84f90925.zip |
Update dependencies (#1610)
* Update dependencies
* Update module to go 1.17
Diffstat (limited to 'vendor/github.com/mattermost/mattermost-server/v5/model/compliance.go')
-rw-r--r-- | vendor/github.com/mattermost/mattermost-server/v5/model/compliance.go | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/vendor/github.com/mattermost/mattermost-server/v5/model/compliance.go b/vendor/github.com/mattermost/mattermost-server/v5/model/compliance.go index a86087c1..0211805e 100644 --- a/vendor/github.com/mattermost/mattermost-server/v5/model/compliance.go +++ b/vendor/github.com/mattermost/mattermost-server/v5/model/compliance.go @@ -37,6 +37,19 @@ type Compliance struct { type Compliances []Compliance +// ComplianceExportCursor is used for paginated iteration of posts +// for compliance export. +// We need to keep track of the last post ID in addition to the last post +// CreateAt to break ties when two posts have the same CreateAt. +type ComplianceExportCursor struct { + LastChannelsQueryPostCreateAt int64 + LastChannelsQueryPostID string + ChannelsQueryCompleted bool + LastDirectMessagesQueryPostCreateAt int64 + LastDirectMessagesQueryPostID string + DirectMessagesQueryCompleted bool +} + func (c *Compliance) ToJson() string { b, _ := json.Marshal(c) return string(b) @@ -58,6 +71,11 @@ func (c *Compliance) PreSave() { c.CreateAt = GetMillis() } +func (c *Compliance) DeepCopy() *Compliance { + copy := *c + return © +} + func (c *Compliance) JobName() string { jobName := c.Type if c.Type == COMPLIANCE_TYPE_DAILY { @@ -79,7 +97,7 @@ func (c *Compliance) IsValid() *AppError { return NewAppError("Compliance.IsValid", "model.compliance.is_valid.create_at.app_error", nil, "", http.StatusBadRequest) } - if len(c.Desc) > 512 || len(c.Desc) == 0 { + if len(c.Desc) > 512 || c.Desc == "" { return NewAppError("Compliance.IsValid", "model.compliance.is_valid.desc.app_error", nil, "", http.StatusBadRequest) } @@ -105,11 +123,11 @@ func ComplianceFromJson(data io.Reader) *Compliance { } func (c Compliances) ToJson() string { - if b, err := json.Marshal(c); err != nil { + b, err := json.Marshal(c) + if err != nil { return "[]" - } else { - return string(b) } + return string(b) } func CompliancesFromJson(data io.Reader) Compliances { |