From dcf7c282a6aa1b961ef69a0d370f9bd5c88a055b Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 29 Jun 2023 22:22:12 +0300 Subject: [PATCH] fix editing push notif --- files/routes/comments.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index fb0b8628f..5bf7070e0 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -647,6 +647,22 @@ def edit_comment(cid, v): if v.marseyawarded and marseyaward_body_regex.search(body_html): abort(403, "You can only type marseys!") + c.body = body + + c.body_html = body_html + + execute_blackjack(v, c, c.body, "comment") + + if not complies_with_chud(c): + abort(403, f'You have to include "{v.chud_phrase}" in your comment!') + + process_poll_options(v, c) + + if int(time.time()) - c.created_utc > 60 * 3: + c.edited_utc = int(time.time()) + + g.db.add(c) + notify_users = NOTIFY_USERS(body, v, c.body, ghost=c.ghost, log_cost=c) if notify_users == 'everyone': @@ -660,22 +676,6 @@ def edit_comment(cid, v): if not v.shadowbanned: push_notif({x}, f'New mention of you by @{c.author_name}', c.body, c) - c.body = body - - process_poll_options(v, c) - - c.body_html = body_html - - execute_blackjack(v, c, c.body, "comment") - - if not complies_with_chud(c): - abort(403, f'You have to include "{v.chud_phrase}" in your comment!') - - - if int(time.time()) - c.created_utc > 60 * 3: c.edited_utc = int(time.time()) - - g.db.add(c) - g.db.flush() return {"body": c.body, "comment": c.realbody(v)}