LGB: extend block & follower vis permissioning.

master
Snakes 2022-07-19 22:29:45 -04:00
parent f23b93fbe9
commit a2ca535ce3
Signed by: Snakes
GPG Key ID: E745A82778055C7E
2 changed files with 11 additions and 6 deletions

View File

@ -641,6 +641,7 @@ def settings_block_user(v):
)
g.db.add(new_block)
if user.admin_level >= PERMS['USER_BLOCKS_VISIBLE']:
send_notification(user.id, f"@{v.username} has blocked you!")
cache.delete_memoized(frontlist)
@ -663,7 +664,7 @@ def settings_unblock_user(v):
g.db.delete(x)
if not v.shadowbanned:
if not v.shadowbanned and user.admin_level >= PERMS['USER_BLOCKS_VISIBLE']:
send_notification(user.id, f"@{v.username} has unblocked you!")
cache.delete_memoized(frontlist)

View File

@ -128,9 +128,11 @@
<img alt="marseybux" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Marseybux" height="20" width="46" src="/i/marseybux.webp?v=2000">&nbsp;&nbsp;
{% endif %}
{% if PERMS['USER_FOLLOWS_VISIBLE'] == 0 or (v and v.admin_level >= PERMS['USER_FOLLOWS_VISIBLE']) -%}
<a href="/@{{u.username}}/followers" id="profile--followers">{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}</a>&nbsp;&nbsp;
<a href="/@{{u.username}}/following" id="profile--following">follows {{u.follow_count}} user{{'s' if u.follow_count != 1 else ''}}</a>&nbsp;&nbsp;
{%- endif %}
<span id="profile--joined">joined <span id="profile--joined--time" data-bs-toggle="tooltip" data-bs-placement="bottom" onmouseover="timestamp('profile--joined--time','{{u.created_utc}}')">{{u.created_date}}</span></span>
@ -449,9 +451,11 @@
<img alt="marseybux" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Marseybux" height="15" width="35" src="/i/marseybux.webp?v=2000">&nbsp;&nbsp;
{% endif %}
{% if PERMS['USER_FOLLOWS_VISIBLE'] == 0 or (v and v.admin_level >= PERMS['USER_FOLLOWS_VISIBLE']) -%}
<a href="/@{{u.username}}/followers" class="font-weight-bold" id="profile-mobile--followers">{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}</a>&nbsp;&nbsp;
<a href="/@{{u.username}}/following" class="font-weight-bold" id="profile-mobile--following" style="display:block">follows {{u.follow_count}} user{{'s' if u.follow_count != 1 else ''}}</a>&nbsp;&nbsp;
{%- endif %}
{% if u.basedcount %}
<br><span id="profile-mobile--based">Based count: {{u.basedcount}}</span>