Banning a user now automatically hides all their posts

This commit is contained in:
Phillip Thelen
2022-12-09 13:02:49 +01:00
parent 580139ff69
commit a018588021
4 changed files with 17 additions and 3 deletions
@@ -9,6 +9,7 @@ import {
NotFound,
} from '../../libs/errors';
import apiError from '../../libs/apiError';
import { flagAllMessages } from '../../libs/chat/group-chat';
import {
validateItemPath,
castItemVal,
@@ -336,6 +337,7 @@ api.updateHero = {
if (updateData.auth && updateData.auth.blocked === true) {
hero.auth.blocked = updateData.auth.blocked;
hero.preferences.sleep = true; // when blocking, have them rest at an inn to prevent damage
await flagAllMessages(hero);
}
if (updateData.auth && updateData.auth.blocked === false) {
hero.auth.blocked = false;