BUGFIX: Don't include deleted topics in activity. Deleted posts are OK.

This commit is contained in:
Robin Ward 2014-02-28 11:14:36 -05:00
parent ca9f6e9137
commit 67463af4f4
1 changed files with 5 additions and 1 deletions

View File

@ -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