🐛 Fix visibility filter will filter user own psots
This commit is contained in:
parent
830484fee1
commit
e9c7921d39
@ -29,7 +29,8 @@ func FilterPostWithUserContext(tx *gorm.DB, user *models.Account) *gorm.DB {
|
|||||||
// TODO Blocked by dealer, need support get friend list
|
// TODO Blocked by dealer, need support get friend list
|
||||||
tx = tx.Where("visibility != ? OR visibility != ?", FriendsVisibility, NoneVisibility).
|
tx = tx.Where("visibility != ? OR visibility != ?", FriendsVisibility, NoneVisibility).
|
||||||
Or("visibility = ? AND ?", SelectedVisibility, datatypes.JSONQuery("visible_users").HasKey(strconv.Itoa(int(user.ID)))).
|
Or("visibility = ? AND ?", SelectedVisibility, datatypes.JSONQuery("visible_users").HasKey(strconv.Itoa(int(user.ID)))).
|
||||||
Or("visibility = ? AND NOT ?", SelectedVisibility, datatypes.JSONQuery("invisible_users").HasKey(strconv.Itoa(int(user.ID))))
|
Or("visibility = ? AND NOT ?", SelectedVisibility, datatypes.JSONQuery("invisible_users").HasKey(strconv.Itoa(int(user.ID)))).
|
||||||
|
Or("author_id = ?", user.ID)
|
||||||
|
|
||||||
return tx
|
return tx
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user