fix reddit mention bugs

remotes/1693045480750635534/spooky-22
Aevann1 2022-07-10 16:09:41 +02:00
parent 9ea0f46250
commit 0b7a5208e9
2 changed files with 8 additions and 3 deletions

View File

@ -498,7 +498,7 @@ class User(Base):
return g.db.query(Notification).join(Comment).filter(
Notification.user_id == self.id, Notification.read == False,
Comment.is_banned == False, Comment.deleted_utc == 0,
Comment.body_html.like('%<p>New site mention: <a href="https://old.reddit.com/r/%'),
Comment.body_html.like('%<p>New site mention%<a href="https://old.reddit.com/r/%'),
Comment.parent_submission == None, Comment.author_id == AUTOJANNY_ID).count()
@property

View File

@ -175,7 +175,12 @@ def notifications_reddit(v):
if not v.can_view_offsitementions: abort(403)
notifications = g.db.query(Notification, Comment).join(Notification.comment).filter(Notification.user_id == v.id, Comment.body_html.like('%<p>New site mention: <a href="https://old.reddit.com/r/%'), Comment.parent_submission == None, Comment.author_id == AUTOJANNY_ID).order_by(Notification.created_utc.desc()).offset(25 * (page - 1)).limit(101).all()
notifications = g.db.query(Notification, Comment).join(Notification.comment).filter(
Notification.user_id == v.id,
Comment.body_html.like('%<p>New site mention%<a href="https://old.reddit.com/r/%'),
Comment.parent_submission == None,
Comment.author_id == AUTOJANNY_ID
).order_by(Notification.created_utc.desc()).offset(25 * (page - 1)).limit(101).all()
listing = []
@ -217,7 +222,7 @@ def notifications(v):
Notification.user_id == v.id,
Comment.is_banned == False,
Comment.deleted_utc == 0,
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/%'),
Comment.body_html.notlike(f'%<p>{NOTIF_MODACTION_PREFIX}%')
).order_by(Notification.created_utc.desc())