aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
Diffstat (limited to 'server/models')
-rw-r--r--server/models/server/server.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/server/models/server/server.ts b/server/models/server/server.ts
index 8b07115f1..5131257ec 100644
--- a/server/models/server/server.ts
+++ b/server/models/server/server.ts
@@ -71,6 +71,13 @@ export class ServerModel extends Model<ServerModel> {
71 return ServerModel.findOne(query) 71 return ServerModel.findOne(query)
72 } 72 }
73 73
74 static async loadOrCreateByHost (host: string) {
75 let server = await ServerModel.loadByHost(host)
76 if (!server) server = await ServerModel.create({ host })
77
78 return server
79 }
80
74 isBlocked () { 81 isBlocked () {
75 return this.BlockedByAccounts && this.BlockedByAccounts.length !== 0 82 return this.BlockedByAccounts && this.BlockedByAccounts.length !== 0
76 } 83 }