From 9982d13930d649092934732e74ebca373db2eea6 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 19 Apr 2018 18:54:34 +0900 Subject: [PATCH] Implement suspend account --- cli/suspend.js | 18 ++++++++++++++++++ locales/en.yml | 2 ++ locales/fr.yml | 2 ++ locales/ja.yml | 2 ++ .../desktop/views/pages/user/user.header.vue | 12 ++++++++++-- src/client/app/mobile/views/pages/user.vue | 12 ++++++++++-- src/remote/activitypub/models/image.ts | 5 +++++ src/remote/activitypub/models/note.ts | 5 +++++ 8 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 cli/suspend.js diff --git a/cli/suspend.js b/cli/suspend.js new file mode 100644 index 000000000..0f22bba47 --- /dev/null +++ b/cli/suspend.js @@ -0,0 +1,18 @@ +const mongo = require('mongodb'); +const User = require('../built/models/user').default; + +const args = process.argv.slice(2); + +const userId = new mongo.ObjectID(args[0]); + +console.log(`Suspending ${userId}...`); + +User.update({ _id: userId }, { + $set: { + isSuspended: true + } +}).then(() => { + console.log(`Suspended ${userId}`); +}, e => { + console.error(e); +}); diff --git a/locales/en.yml b/locales/en.yml index 4eb0a3446..81357c075 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -406,6 +406,7 @@ desktop/views/pages/user/user.friends.vue: no-users: "No users" desktop/views/pages/user/user.header.vue: + is-suspended: "This account has been suspended." is-remote: "This user is a remote user, so the information is not accurate. " view-remote: "See accurate information" @@ -594,6 +595,7 @@ mobile/views/pages/user.vue: overview: "Overview" timeline: "Timeline" media: "Media" + is-suspended: "This account has been suspended." is-remote: "This user is a remote user, so the information is not accurate. " view-remote: "See accurate information" diff --git a/locales/fr.yml b/locales/fr.yml index 0e0019e56..8fb754344 100644 --- a/locales/fr.yml +++ b/locales/fr.yml @@ -406,6 +406,7 @@ desktop/views/pages/user/user.friends.vue: no-users: "Pas d'utilisateurs" desktop/views/pages/user/user.header.vue: + is-suspended: "This account has been suspended." is-remote: "Cet utilisateur n'est pas un utilisateur de Misskey. Certaines informations peuvent être erronées " view-remote: "Voir les informations détaillées" @@ -594,6 +595,7 @@ mobile/views/pages/user.vue: overview: "Aperçu" timeline: "Fil d'actualité" media: "Media" + is-suspended: "This account has been suspended." is-remote: "Cet utilisateur n'est pas un utilisateur de Misskey. Certaines informations peuvent être erronées " view-remote: "Voir les informations détaillées" diff --git a/locales/ja.yml b/locales/ja.yml index f5d304349..2f69a6f3d 100644 --- a/locales/ja.yml +++ b/locales/ja.yml @@ -406,6 +406,7 @@ desktop/views/pages/user/user.friends.vue: no-users: "よく話すユーザーはいません" desktop/views/pages/user/user.header.vue: + is-suspended: "このユーザーは凍結されています。" is-remote: "このユーザーはリモートユーザーです。" view-remote: "正確な情報を見る" @@ -594,6 +595,7 @@ mobile/views/pages/user.vue: overview: "概要" timeline: "タイムライン" media: "メディア" + is-suspended: "このユーザーは凍結されています。" is-remote: "このユーザーはリモートユーザーです。" view-remote: "正確な情報を見る" diff --git a/src/client/app/desktop/views/pages/user/user.header.vue b/src/client/app/desktop/views/pages/user/user.header.vue index 90bedf716..5c94c8688 100644 --- a/src/client/app/desktop/views/pages/user/user.header.vue +++ b/src/client/app/desktop/views/pages/user/user.header.vue @@ -1,5 +1,6 @@