MM-17468 - Improve thread fetching (#13653)

* Revert "Thread fetching revert (#13616)"

This reverts commit 8e0fe90897.

* renamed query param for clarity

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Eli Yukelzon
2020-02-05 13:27:35 +01:00
коммит произвёл GitHub
родитель 57717a23af
Коммит 597a2b77cd
17 изменённых файлов: 541 добавлений и 322 удалений

Просмотреть файл

@@ -74,7 +74,6 @@ type Post struct {
OriginalId string `json:"original_id"`
Message string `json:"message"`
// MessageSource will contain the message as submitted by the user if Message has been modified
// by Mattermost for presentation (e.g if an image proxy is being used). It should be used to
// populate edit boxes if present.
@@ -89,7 +88,8 @@ type Post struct {
HasReactions bool `json:"has_reactions,omitempty"`
// Transient data populated before sending a post to the client
Metadata *PostMetadata `json:"metadata,omitempty" db:"-"`
ReplyCount int64 `json:"reply_count" db:"-"`
Metadata *PostMetadata `json:"metadata,omitempty" db:"-"`
}
type PostEphemeral struct {
@@ -171,6 +171,20 @@ func (o *Post) ToUnsanitizedJson() string {
return string(b)
}
type GetPostsSinceOptions struct {
ChannelId string
Time int64
SkipFetchThreads bool
}
type GetPostsOptions struct {
ChannelId string
PostId string
Page int
PerPage int
SkipFetchThreads bool
}
func PostFromJson(data io.Reader) *Post {
var o *Post
json.NewDecoder(data).Decode(&o)