allow ppl to see linked comments of ppl they block instead of getting a 403 https://rdrama.net/h/changelog/post/165657/changelog-megathread-marseynotes/4791944#context

master
Aevann 2023-08-16 00:09:37 +03:00
parent b540b9fe3c
commit 31140bdefb
2 changed files with 3 additions and 3 deletions

View File

@ -1137,7 +1137,7 @@ class User(Base):
if SITE == 'watchpeopledie.tv' and other.id == 5: if SITE == 'watchpeopledie.tv' and other.id == 5:
return False return False
else: else:
if hasattr(other, 'is_blocking') and other.is_blocking: if hasattr(other, 'is_blocking') and other.is_blocking and not request.path.endswith(f'/{other.id}'):
return False return False
if other.parent_post: if other.parent_post:
return cls.can_see(user, other.post) return cls.can_see(user, other.post)

View File

@ -23,7 +23,7 @@
{% set replies=c.replies(sort=sort) %} {% set replies=c.replies(sort=sort) %}
{% endif %} {% endif %}
{% if c.is_blocking and not c.ghost or (c.is_banned or c.deleted_utc) and not (v and v.admin_level >= PERMS['POST_COMMENT_MODERATION']) and not (v and v.id==c.author_id) %} {% if (c.is_banned or c.deleted_utc) and not (v and v.admin_level >= PERMS['POST_COMMENT_MODERATION']) and not (v and v.id==c.author_id) %}
<div id="comment-{{c.id}}" class="comment {% if not (v and v.id == author_id) and not (v and v.admin_level) and not comment_info %}collapsed{% endif %}"> <div id="comment-{{c.id}}" class="comment {% if not (v and v.id == author_id) and not (v and v.admin_level) and not comment_info %}collapsed{% endif %}">
<span class="comment-collapse-desktop" style="border-color: #{{c.author.name_color}}" data-nonce="{{g.nonce}}" data-onclick="collapse_comment('{{c.id}}')"></span> <span class="comment-collapse-desktop" style="border-color: #{{c.author.name_color}}" data-nonce="{{g.nonce}}" data-onclick="collapse_comment('{{c.id}}')"></span>
<div class="comment-body"> <div class="comment-body">
@ -31,7 +31,7 @@
<div class="user-info"> <div class="user-info">
<span class="comment-collapse-icon" data-nonce="{{g.nonce}}" data-onclick="collapse_comment('{{c.id}}')"></span> <span class="comment-collapse-icon" data-nonce="{{g.nonce}}" data-onclick="collapse_comment('{{c.id}}')"></span>
{% if standalone and c.over_18 %}<span class="badge badge-danger">+18</span> {% endif %} {% if standalone and c.over_18 %}<span class="badge badge-danger">+18</span> {% endif %}
{% if c.is_banned %}Removed by @{{c.ban_reason}} (Site Admin){% elif c.deleted_utc %}Deleted by author{% elif c.is_blocking %}You are blocking @{{c.author_name}}{% endif %} {% if c.is_banned %}Removed by @{{c.ban_reason}} (Site Admin){% elif c.deleted_utc %}Deleted by author{% endif %}
</div> </div>
</div> </div>
{% if render_replies %} {% if render_replies %}