✨ Post channel modes
This commit is contained in:
@ -26,9 +26,9 @@ func getPostInsight(c *fiber.Ctx) error {
|
||||
tx := services.FilterPostDraft(database.C)
|
||||
|
||||
if user, authenticated := c.Locals("user").(authm.Account); authenticated {
|
||||
tx = services.FilterPostWithUserContext(tx, &user, len(c.Query("realm")) > 0)
|
||||
tx = services.FilterPostWithUserContext(c, tx, &user)
|
||||
} else {
|
||||
tx = services.FilterPostWithUserContext(tx, nil, len(c.Query("realm")) > 0)
|
||||
tx = services.FilterPostWithUserContext(c, tx, nil)
|
||||
}
|
||||
|
||||
if numericId, paramErr := strconv.Atoi(id); paramErr == nil {
|
||||
|
@ -24,9 +24,9 @@ func UniversalPostFilter(c *fiber.Ctx, tx *gorm.DB) (*gorm.DB, error) {
|
||||
tx = services.FilterPostDraft(tx)
|
||||
|
||||
if user, authenticated := c.Locals("user").(authm.Account); authenticated {
|
||||
tx = services.FilterPostWithUserContext(tx, &user, len(c.Query("realm")) > 0)
|
||||
tx = services.FilterPostWithUserContext(c, tx, &user)
|
||||
} else {
|
||||
tx = services.FilterPostWithUserContext(tx, nil, len(c.Query("realm")) > 0)
|
||||
tx = services.FilterPostWithUserContext(c, tx, nil)
|
||||
}
|
||||
|
||||
if c.QueryBool("noReply", true) {
|
||||
@ -71,9 +71,9 @@ func getPost(c *fiber.Ctx) error {
|
||||
tx := services.FilterPostDraft(database.C)
|
||||
|
||||
if user, authenticated := c.Locals("user").(authm.Account); authenticated {
|
||||
tx = services.FilterPostWithUserContext(tx, &user, len(c.Query("realm")) > 0)
|
||||
tx = services.FilterPostWithUserContext(c, tx, &user)
|
||||
} else {
|
||||
tx = services.FilterPostWithUserContext(tx, nil, len(c.Query("realm")) > 0)
|
||||
tx = services.FilterPostWithUserContext(c, tx, nil)
|
||||
}
|
||||
|
||||
if numericId, paramErr := strconv.Atoi(id); paramErr == nil {
|
||||
|
@ -20,7 +20,7 @@ func getWhatsNew(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
tx := services.FilterPostDraft(database.C)
|
||||
tx = services.FilterPostWithUserContext(tx, &user, len(c.Query("realm")) > 0)
|
||||
tx = services.FilterPostWithUserContext(c, tx, &user)
|
||||
|
||||
tx = tx.Where("id > ?", pivot)
|
||||
|
||||
|
Reference in New Issue
Block a user