BUGFIX: Don't include deleted topics in activity. Deleted posts are OK.
This commit is contained in:
parent
ca9f6e9137
commit
67463af4f4
|
@ -263,8 +263,12 @@ SQL
|
|||
|
||||
def self.apply_common_filters(builder,user_id,guardian,ignore_private_messages=false)
|
||||
|
||||
# We never return deleted topics in activity
|
||||
builder.where("t.deleted_at is null")
|
||||
|
||||
# We will return deleted posts though if the user can see it
|
||||
unless guardian.can_see_deleted_posts?
|
||||
builder.where("p.deleted_at is null and p2.deleted_at is null and t.deleted_at is null")
|
||||
builder.where("p.deleted_at is null and p2.deleted_at is null")
|
||||
|
||||
current_user_id = -2
|
||||
current_user_id = guardian.user.id if guardian.user
|
||||
|
|
Loading…
Reference in New Issue