forked from MarseyWorld/MarseyWorld
fix muted users not notifying the person they reply to
parent
20eef6e063
commit
62fcaec40d
|
@ -625,9 +625,13 @@ class User(Base):
|
|||
.filter(
|
||||
Notification.read == False,
|
||||
Notification.user_id == self.id,
|
||||
not_(and_(Comment.sentto == MODMAIL_ID, User.is_muted)),
|
||||
))
|
||||
|
||||
if self.admin_level >= PERMS['VIEW_MODMAIL']:
|
||||
notifs = notifs.filter(
|
||||
not_(and_(Comment.sentto != None, Comment.sentto == MODMAIL_ID, User.is_muted))
|
||||
)
|
||||
|
||||
if not self.can_see_shadowbanned:
|
||||
notifs = notifs.filter(
|
||||
User.shadowbanned == None,
|
||||
|
|
|
@ -301,10 +301,14 @@ def notifications(v:User):
|
|||
n.read = True
|
||||
g.db.add(n)
|
||||
|
||||
comments = g.db.query(Comment, Notification).join(Notification.comment).join(Comment.author).filter(
|
||||
comments = g.db.query(Comment, Notification).join(Notification.comment).filter(
|
||||
Notification.user_id == v.id,
|
||||
or_(Comment.sentto == None, Comment.sentto != v.id),
|
||||
not_(and_(Comment.sentto == MODMAIL_ID, User.is_muted)),
|
||||
)
|
||||
|
||||
if v.admin_level >= PERMS['VIEW_MODMAIL']:
|
||||
comments = comments.join(Comment.author).filter(
|
||||
not_(and_(Comment.sentto != None, Comment.sentto == MODMAIL_ID, User.is_muted))
|
||||
)
|
||||
|
||||
if v.admin_level < PERMS['USER_SHADOWBAN']:
|
||||
|
|
Loading…
Reference in New Issue