diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index 6f3e78de04..7c743d4e46 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -102,9 +102,10 @@ def NOTIFY_USERS(text, v): if word in text.lower() and id not in notify_users and v.id != id: notify_users.add(id) soup = BeautifulSoup(text, features="html.parser") - for mention in soup.find_all("a", href=re.compile("^/@(\w+)")): - username = mention["href"].split("@")[1] - user = g.db.query(User).filter_by(username=username).one_or_none() - if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id) + for mention in soup.find_all("a", href=re.compile("^\/id\/([0-9]+)")): + id = mention["href"].split("/id/")[1] + if id != v.id: + user = g.db.query(User).filter_by(id=id).one_or_none() + if user and not v.any_block_exists(user): notify_users.add(user.id) return notify_users \ No newline at end of file diff --git a/files/templates/comments.html b/files/templates/comments.html index f817cc1e6a..efa09c8d5c 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -518,31 +518,7 @@ {% if render_replies %} - {% if level<10 %} -
- {% for reply in replies %} - {{single_comment(reply, level=level+1)}} - {% endfor %} -
- {% elif replies and "notifications" in request.path %} -
- {% set standalone=False %} - {% for reply in replies %} - {{single_comment(reply, level=level+1)}} - {% endfor %} -
-
- More comments -
- {% elif replies %} -
- - More comments -
- {% endif %} - - - {% if request.path == '/notifications' and not replies and not c.parent_submission and c.author_id not in (NOTIFICATIONS_ID, AUTOJANNY_ID) %} + {% if request.path == '/notifications' and not replies and c.sentto and not c.parent_submission and c.author_id not in (NOTIFICATIONS_ID, AUTOJANNY_ID) %} Reply

 			
@@ -562,6 +538,17 @@
+ {% elif level<10 %} +
+ {% for reply in replies %} + {{single_comment(reply, level=level+1)}} + {% endfor %} +
+ {% elif replies %} +
+ + More comments +
{% endif %} {% endif %} @@ -853,7 +840,7 @@ {% if v %} - + {% endif %} diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 2cce236996..dc87c3bfc9 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -254,7 +254,7 @@ {% endif %} {% if v %} - +