Thread fetching revert (#13616)
* Revert "MM-19371 - Reply count disappears from pinned and flagged conv… (#12753)"
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
da97740cc2
Коммит
8e0fe90897
27
api4/post.go
27
api4/post.go
@@ -148,10 +148,6 @@ func getPostsForChannel(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
}
|
||||
skipFetchThreads := false
|
||||
if r.URL.Query().Get("fetchThreads") == "false" {
|
||||
skipFetchThreads = true
|
||||
}
|
||||
|
||||
channelId := c.Params.ChannelId
|
||||
page := c.Params.Page
|
||||
@@ -167,7 +163,7 @@ func getPostsForChannel(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
etag := ""
|
||||
|
||||
if since > 0 {
|
||||
list, err = c.App.GetPostsSince(model.GetPostsSinceOptions{ChannelId: channelId, Time: since, SkipFetchThreads: skipFetchThreads})
|
||||
list, err = c.App.GetPostsSince(channelId, since)
|
||||
} else if len(afterPost) > 0 {
|
||||
etag = c.App.GetPostsEtag(channelId)
|
||||
|
||||
@@ -175,7 +171,7 @@ func getPostsForChannel(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
list, err = c.App.GetPostsAfterPost(model.GetPostsOptions{ChannelId: channelId, PostId: afterPost, Page: page, PerPage: perPage, SkipFetchThreads: skipFetchThreads})
|
||||
list, err = c.App.GetPostsAfterPost(channelId, afterPost, page, perPage)
|
||||
} else if len(beforePost) > 0 {
|
||||
etag = c.App.GetPostsEtag(channelId)
|
||||
|
||||
@@ -183,7 +179,7 @@ func getPostsForChannel(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
list, err = c.App.GetPostsBeforePost(model.GetPostsOptions{ChannelId: channelId, PostId: beforePost, Page: page, PerPage: perPage, SkipFetchThreads: skipFetchThreads})
|
||||
list, err = c.App.GetPostsBeforePost(channelId, beforePost, page, perPage)
|
||||
} else {
|
||||
etag = c.App.GetPostsEtag(channelId)
|
||||
|
||||
@@ -191,7 +187,7 @@ func getPostsForChannel(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
list, err = c.App.GetPostsPage(model.GetPostsOptions{ChannelId: channelId, Page: page, PerPage: perPage, SkipFetchThreads: skipFetchThreads})
|
||||
list, err = c.App.GetPostsPage(channelId, page, perPage)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
@@ -227,11 +223,7 @@ func getPostsForChannelAroundLastUnread(c *Context, w http.ResponseWriter, r *ht
|
||||
return
|
||||
}
|
||||
|
||||
skipFetchThreads := false
|
||||
if r.URL.Query().Get("fetchThreads") == "false" {
|
||||
skipFetchThreads = true
|
||||
}
|
||||
postList, err := c.App.GetPostsForChannelAroundLastUnread(channelId, userId, c.Params.LimitBefore, c.Params.LimitAfter, skipFetchThreads)
|
||||
postList, err := c.App.GetPostsForChannelAroundLastUnread(channelId, userId, c.Params.LimitBefore, c.Params.LimitAfter)
|
||||
if err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
@@ -245,7 +237,7 @@ func getPostsForChannelAroundLastUnread(c *Context, w http.ResponseWriter, r *ht
|
||||
return
|
||||
}
|
||||
|
||||
postList, err = c.App.GetPostsPage(model.GetPostsOptions{ChannelId: channelId, Page: app.PAGE_DEFAULT, PerPage: c.Params.LimitBefore, SkipFetchThreads: skipFetchThreads})
|
||||
postList, err = c.App.GetPostsPage(channelId, app.PAGE_DEFAULT, c.Params.LimitBefore)
|
||||
if err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
@@ -399,11 +391,8 @@ func getPostThread(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
if c.Err != nil {
|
||||
return
|
||||
}
|
||||
skipFetchThreads := false
|
||||
if r.URL.Query().Get("fetchThreads") == "false" {
|
||||
skipFetchThreads = true
|
||||
}
|
||||
list, err := c.App.GetPostThread(c.Params.PostId, skipFetchThreads)
|
||||
|
||||
list, err := c.App.GetPostThread(c.Params.PostId)
|
||||
if err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
|
||||
Ссылка в новой задаче
Block a user