forked from rDrama/rDrama
1
0
Fork 0

Hide block & follow notifs from shadowed.

master
Snakes 2022-06-12 22:11:55 -04:00
parent 0fe3936cbb
commit fb52003404
2 changed files with 8 additions and 4 deletions

View File

@ -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)

View File

@ -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!"}