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 удалений

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

@@ -501,7 +501,7 @@ func (api *PluginAPI) DeletePost(postId string) *model.AppError {
}
func (api *PluginAPI) GetPostThread(postId string) (*model.PostList, *model.AppError) {
return api.app.GetPostThread(postId)
return api.app.GetPostThread(postId, false)
}
func (api *PluginAPI) GetPost(postId string) (*model.Post, *model.AppError) {
@@ -509,19 +509,19 @@ func (api *PluginAPI) GetPost(postId string) (*model.Post, *model.AppError) {
}
func (api *PluginAPI) GetPostsSince(channelId string, time int64) (*model.PostList, *model.AppError) {
return api.app.GetPostsSince(channelId, time)
return api.app.GetPostsSince(model.GetPostsSinceOptions{ChannelId: channelId, Time: time})
}
func (api *PluginAPI) GetPostsAfter(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError) {
return api.app.GetPostsAfterPost(channelId, postId, page, perPage)
return api.app.GetPostsAfterPost(model.GetPostsOptions{ChannelId: channelId, PostId: postId, Page: page, PerPage: perPage})
}
func (api *PluginAPI) GetPostsBefore(channelId, postId string, page, perPage int) (*model.PostList, *model.AppError) {
return api.app.GetPostsBeforePost(channelId, postId, page, perPage)
return api.app.GetPostsBeforePost(model.GetPostsOptions{ChannelId: channelId, PostId: postId, Page: page, PerPage: perPage})
}
func (api *PluginAPI) GetPostsForChannel(channelId string, page, perPage int) (*model.PostList, *model.AppError) {
return api.app.GetPostsPage(channelId, page, perPage)
return api.app.GetPostsPage(model.GetPostsOptions{ChannelId: channelId, Page: perPage, PerPage: page})
}
func (api *PluginAPI) UpdatePost(post *model.Post) (*model.Post, *model.AppError) {