From a2ca535ce347ec2378d6eb81cc0a59f819cfa546 Mon Sep 17 00:00:00 2001 From: TLSM Date: Tue, 19 Jul 2022 22:29:45 -0400 Subject: [PATCH] LGB: extend block & follower vis permissioning. --- files/routes/settings.py | 5 +++-- files/templates/userpage.html | 12 ++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/files/routes/settings.py b/files/routes/settings.py index fd76b9db2..20669bcc8 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -641,7 +641,8 @@ def settings_block_user(v): ) g.db.add(new_block) - send_notification(user.id, f"@{v.username} has blocked you!") + 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) diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 66eec2ebb..65727fef0 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -128,9 +128,11 @@ marseybux   {% endif %} - {{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}   + {% if PERMS['USER_FOLLOWS_VISIBLE'] == 0 or (v and v.admin_level >= PERMS['USER_FOLLOWS_VISIBLE']) -%} + {{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}   - follows {{u.follow_count}} user{{'s' if u.follow_count != 1 else ''}}   + follows {{u.follow_count}} user{{'s' if u.follow_count != 1 else ''}}   + {%- endif %} joined {{u.created_date}} @@ -449,9 +451,11 @@ marseybux   {% endif %} - {{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}   + {% if PERMS['USER_FOLLOWS_VISIBLE'] == 0 or (v and v.admin_level >= PERMS['USER_FOLLOWS_VISIBLE']) -%} + {{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}   - follows {{u.follow_count}} user{{'s' if u.follow_count != 1 else ''}}   + follows {{u.follow_count}} user{{'s' if u.follow_count != 1 else ''}}   + {%- endif %} {% if u.basedcount %}
Based count: {{u.basedcount}}