👔 Updated collapse post
This commit is contained in:
parent
69e9a108ef
commit
d189c5a8d8
@ -26,6 +26,10 @@ func NewFlag(post models.Post, account uint) (models.PostFlag, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func FlagCalculateCollapseStatus(post models.Post) error {
|
func FlagCalculateCollapseStatus(post models.Post) error {
|
||||||
|
if post.TotalViews <= 2 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
collapseLimit := 0.5
|
collapseLimit := 0.5
|
||||||
|
|
||||||
var flagCount int64
|
var flagCount int64
|
||||||
|
@ -48,9 +48,6 @@ func UniversalPostFilter(c *fiber.Ctx, tx *gorm.DB, cfg ...UniversalPostFilterCo
|
|||||||
if c.QueryBool("noReply", true) && !config.ShowReply {
|
if c.QueryBool("noReply", true) && !config.ShowReply {
|
||||||
tx = FilterPostReply(tx)
|
tx = FilterPostReply(tx)
|
||||||
}
|
}
|
||||||
if c.QueryBool("noCollapse", true) && !config.ShowCollapsed {
|
|
||||||
tx = tx.Where("is_collapsed = ? OR is_collapsed IS NULL", false)
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(c.Query("author")) > 0 {
|
if len(c.Query("author")) > 0 {
|
||||||
var author models.Publisher
|
var author models.Publisher
|
||||||
|
Loading…
x
Reference in New Issue
Block a user