+ if (!await doesUnblockAccountExist(serverActor.Account.id, targetAccount.id, res)) return
+
+ return next()
+ }
+]
+
+const blockServerValidator = [
+ body('host')
+ .custom(isHostValid),
+
+ async (req: express.Request, res: express.Response, next: express.NextFunction) => {
+ if (areValidationErrors(req, res)) return
+
+ const host: string = req.body.host
+
+ if (host === WEBSERVER.HOST) {
+ return res.fail({
+ status: HttpStatusCode.CONFLICT_409,
+ message: 'You cannot block your own server.'
+ })
+ }
+
+ const server = await ServerModel.loadOrCreateByHost(host)
+
+ res.locals.server = server