take direct messages into account in estimate

This commit is contained in:
codl 2017-12-27 22:16:13 +01:00
parent c0c1591dfa
commit 40960fc7fd
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
1 changed files with 2 additions and 0 deletions

View File

@ -177,6 +177,8 @@ class Account(TimestampMixin, RemoteIDMixin):
query = query.filter(db.or_(Post.favourite == False, Post.is_reblog)) query = query.filter(db.or_(Post.favourite == False, Post.is_reblog))
if(self.policy_keep_media): if(self.policy_keep_media):
query = query.filter(db.or_(Post.has_media == False, Post.is_reblog)) query = query.filter(db.or_(Post.has_media == False, Post.is_reblog))
if(self.policy_keep_direct):
query = query.filter(~Post.direct)
return query.count() return query.count()
def force_log_out(self): def force_log_out(self):