summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/mattermost-server/v5/model/thread.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2021-10-17 00:47:22 +0200
committerGitHub <noreply@github.com>2021-10-17 00:47:22 +0200
commit4dd8bae5c91fa4aef09d865d8fef1acd84f90925 (patch)
treeffad9b242daccaf8c86d1c1fbd59032302bd3be9 /vendor/github.com/mattermost/mattermost-server/v5/model/thread.go
parent7ae45c42e712bd0e66c101f3f714c05aa1dc2104 (diff)
downloadmatterbridge-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/thread.go')
-rw-r--r--vendor/github.com/mattermost/mattermost-server/v5/model/thread.go55
1 files changed, 44 insertions, 11 deletions
diff --git a/vendor/github.com/mattermost/mattermost-server/v5/model/thread.go b/vendor/github.com/mattermost/mattermost-server/v5/model/thread.go
index ec091c00..fe4a4014 100644
--- a/vendor/github.com/mattermost/mattermost-server/v5/model/thread.go
+++ b/vendor/github.com/mattermost/mattermost-server/v5/model/thread.go
@@ -16,23 +16,24 @@ type Thread struct {
}
type ThreadResponse struct {
- PostId string `json:"id"`
- ReplyCount int64 `json:"reply_count"`
- LastReplyAt int64 `json:"last_reply_at"`
- LastViewedAt int64 `json:"last_viewed_at"`
- Participants []*User `json:"participants"`
- Post *Post `json:"post"`
+ PostId string `json:"id"`
+ ReplyCount int64 `json:"reply_count"`
+ LastReplyAt int64 `json:"last_reply_at"`
+ LastViewedAt int64 `json:"last_viewed_at"`
+ Participants []*User `json:"participants"`
+ Post *Post `json:"post"`
+ UnreadReplies int64 `json:"unread_replies"`
+ UnreadMentions int64 `json:"unread_mentions"`
}
type Threads struct {
- Total int64 `json:"total"`
- Threads []*ThreadResponse `json:"threads"`
+ Total int64 `json:"total"`
+ TotalUnreadThreads int64 `json:"total_unread_threads"`
+ TotalUnreadMentions int64 `json:"total_unread_mentions"`
+ Threads []*ThreadResponse `json:"threads"`
}
type GetUserThreadsOpts struct {
- // Page specifies which part of the results to return, by PageSize. Default = 0
- Page uint64
-
// PageSize specifies the size of the returned chunk of results. Default = 30
PageSize uint64
@@ -44,6 +45,32 @@ type GetUserThreadsOpts struct {
// Since filters the threads based on their LastUpdateAt timestamp.
Since uint64
+
+ // Before specifies thread id as a cursor for pagination and will return `PageSize` threads before the cursor
+ Before string
+
+ // After specifies thread id as a cursor for pagination and will return `PageSize` threads after the cursor
+ After string
+
+ // Unread will make sure that only threads with unread replies are returned
+ Unread bool
+
+ // TotalsOnly will not fetch any threads and just fetch the total counts
+ TotalsOnly bool
+
+ // TeamOnly will only fetch threads and unreads for the specified team and excludes DMs/GMs
+ TeamOnly bool
+}
+
+func (o *ThreadResponse) ToJson() string {
+ b, _ := json.Marshal(o)
+ return string(b)
+}
+
+func ThreadResponseFromJson(s string) (*ThreadResponse, error) {
+ var t ThreadResponse
+ err := json.Unmarshal([]byte(s), &t)
+ return &t, err
}
func (o *Threads) ToJson() string {
@@ -56,6 +83,12 @@ func (o *Thread) ToJson() string {
return string(b)
}
+func ThreadFromJson(s string) (*Thread, error) {
+ var t Thread
+ err := json.Unmarshal([]byte(s), &t)
+ return &t, err
+}
+
func (o *Thread) Etag() string {
return Etag(o.PostId, o.LastReplyAt)
}