forked from MarseyWorld/MarseyWorld
Adjust shadowed comment visibility.
- Don't show shadowed comments to non-jannies in notifications. - Auto-collapse for jannies in notifs/threads.master
parent
994ca902ca
commit
f6dea300b0
|
@ -362,6 +362,8 @@ class Comment(Base):
|
||||||
|
|
||||||
if self.is_banned: return True
|
if self.is_banned: return True
|
||||||
|
|
||||||
|
if self.author.shadowbanned and not v.shadowbanned: return True
|
||||||
|
|
||||||
if (self.wordle_result) and (not self.body or len(self.body_html) <= 100) and 9 > self.level > 1: return True
|
if (self.wordle_result) and (not self.body or len(self.body_html) <= 100) and 9 > self.level > 1: return True
|
||||||
|
|
||||||
if v and v.filter_words and self.body and any(x in self.body for x in v.filter_words): return True
|
if v and v.filter_words and self.body and any(x in self.body for x in v.filter_words): return True
|
||||||
|
|
|
@ -270,8 +270,12 @@ def notifications(v):
|
||||||
Comment.body_html.notlike('%<p>New site mention%<a href="https://old.reddit.com/r/%'),
|
Comment.body_html.notlike('%<p>New site mention%<a href="https://old.reddit.com/r/%'),
|
||||||
or_(Comment.sentto == None, Comment.sentto == 2),
|
or_(Comment.sentto == None, Comment.sentto == 2),
|
||||||
not_(and_(Comment.sentto == 2, User.is_muted)),
|
not_(and_(Comment.sentto == 2, User.is_muted)),
|
||||||
).order_by(Notification.created_utc.desc())
|
)
|
||||||
|
|
||||||
|
if v.admin_level < PERMS['USER_SHADOWBAN']:
|
||||||
|
comments = comments.filter(User.shadowbanned == None)
|
||||||
|
|
||||||
|
comments = comments.order_by(Notification.created_utc.desc())
|
||||||
comments = comments.offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE+1).all()
|
comments = comments.offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE+1).all()
|
||||||
|
|
||||||
next_exists = (len(comments) > PAGE_SIZE)
|
next_exists = (len(comments) > PAGE_SIZE)
|
||||||
|
|
Loading…
Reference in New Issue