make mutes propagate

pull/92/head
Aevann 2023-01-23 10:06:32 +02:00
parent a0d4b31deb
commit 11aef2ae3d
2 changed files with 9 additions and 0 deletions

View File

@ -1239,6 +1239,7 @@ def mute_user(v:User, user_id):
)
g.db.add(user)
g.db.add(ma)
check_for_alts()
return {"message": f"@{user.username} has been muted!"}

View File

@ -96,6 +96,14 @@ def check_for_alts(current:User, include_current_session=True):
u.ban_reason = current.ban_reason
g.db.add(u)
if u.is_muted:
current.is_muted = u.is_muted
g.db.add(current)
elif current.is_muted:
u.is_muted = current.is_muted
g.db.add(u)
def execute_shadowban_viewers_and_voters(v:Optional[User], target:Union[Submission, Comment]):
if not v or not v.shadowbanned: return
if not target: return