diff --git a/files/routes/settings.py b/files/routes/settings.py index 2b628703c..1bcea826a 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -672,7 +672,8 @@ def settings_block_user(v): if not user: return {"error": "That user doesn't exist."}, 404 if user.unblockable: - send_notification(user.id, f"@{v.username} has tried to block you and failed because of your unblockable status!") + if not v.shadowbanned: + send_notification(user.id, f"@{v.username} has tried to block you and failed because of your unblockable status!") g.db.commit() return {"error": "This user is unblockable."}, 403 @@ -713,7 +714,8 @@ def settings_unblock_user(v): g.db.delete(x) - send_notification(user.id, f"@{v.username} has unblocked you!") + if not v.shadowbanned: + send_notification(user.id, f"@{v.username} has unblocked you!") cache.delete_memoized(frontlist) diff --git a/files/routes/users.py b/files/routes/users.py index adc6e3e12..cb0552e7c 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -1108,7 +1108,8 @@ def follow_user(username, v): target.stored_subscriber_count = g.db.query(Follow).filter_by(target_id=target.id).count() g.db.add(target) - send_notification(target.id, f"@{v.username} has followed you!") + if not v.shadowbanned: + send_notification(target.id, f"@{v.username} has followed you!") g.db.commit() @@ -1123,7 +1124,8 @@ def unfollow_user(username, v): target = get_user(username) if target.fish: - send_notification(target.id, f"@{v.username} has tried to unfollow you and failed because of your fish award!") + if not v.shadowbanned: + send_notification(target.id, f"@{v.username} has tried to unfollow you and failed because of your fish award!") g.db.commit() return {"error": "You can't unfollow this user!"}