Skip to content

Commit

Permalink
Revert "Feat: Option of disable block"
Browse files Browse the repository at this point in the history
This reverts commit 797a4fd.
  • Loading branch information
atsu1125 committed Sep 28, 2023
1 parent da1baeb commit da48056
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 32 deletions.
1 change: 0 additions & 1 deletion locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,6 @@ common/views/components/profile-editor.vue:
auto-accept-followed: "Automatically approve follows from the people you follow"
avoid-search-index: "Avoid search engine index"
isExplorable: "Show in explore"
disableblock: "Disable Block operation"
searchableBy: "Allow post search"
hideFollows-none: "Not hide Following / Followed list"
hideFollows-follower: "Show Following / Followed list only to followers"
Expand Down
1 change: 0 additions & 1 deletion locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,6 @@ common/views/components/profile-editor.vue:
auto-accept-followed: "フォローしているユーザーからのフォローを自動承認する"
avoid-search-index: "検索エンジンによるインデックスを避ける"
isExplorable: "みつけるに表示する"
disableblock: "ブロック操作を無効にする"
searchableBy: "投稿検索を許可する"
hideFollows-none: "フォロー/フォロー一覧を隠さない"
hideFollows-follower: "フォロー/フォロー一覧はフォロワーにのみ公開する"
Expand Down
4 changes: 0 additions & 4 deletions src/client/app/common/views/components/settings/profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
<ui-switch v-model="autoAcceptFollowed" :disabled="!isLocked && !refuseFollow && !carefulBot && !carefulCat && !carefulRemote && !carefulMassive" @change="save(false)">{{ $t('auto-accept-followed') }}</ui-switch>
<ui-switch v-model="avoidSearchIndex" @change="save(false)">{{ $t('avoid-search-index') }}</ui-switch>
<ui-switch v-model="isExplorable" @change="save(false)">{{ $t('isExplorable') }}</ui-switch>
<ui-switch v-model="disableblock" @change="save(false)">{{ $t('disableblock') }}</ui-switch>
<ui-switch v-model="searchableBy" @change="save(false)">{{ $t('searchableBy') }}</ui-switch>
<ui-select v-model="hideFollows" @input="save(false)">
<option value="">{{ $t('hideFollows-none') }}</option>
Expand Down Expand Up @@ -200,7 +199,6 @@ export default Vue.extend({
autoAcceptFollowed: false,
avoidSearchIndex: false,
isExplorable: false,
disableblock: true,
searchableBy: true,
hideFollows: '',
noFederation: false,
Expand Down Expand Up @@ -259,7 +257,6 @@ export default Vue.extend({
this.autoAcceptFollowed = this.$store.state.i.autoAcceptFollowed;
this.avoidSearchIndex = this.$store.state.i.avoidSearchIndex;
this.isExplorable = this.$store.state.i.isExplorable;
this.disableblock = this.$store.state.i.disableblock;
this.searchableBy = this.$store.state.i.searchableBy === 'public';
this.hideFollows = this.$store.state.i.hideFollows;
this.noFederation = this.$store.state.i.noFederation;
Expand Down Expand Up @@ -364,7 +361,6 @@ export default Vue.extend({
autoAcceptFollowed: !!this.autoAcceptFollowed,
avoidSearchIndex: !!this.avoidSearchIndex,
isExplorable: !!this.isExplorable,
disableblock: !!this.disableblock,
hideFollows: this.hideFollows || '',
searchableBy: this.searchableBy ? 'public' : 'none',
fields,
Expand Down
6 changes: 0 additions & 6 deletions src/models/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,6 @@ type IUserBase = {

searchableBy?: 'public' | 'none' | null;

/**
* ブロックボタンを有効化するか
*/
disableblock?: boolean;

/**
* このアカウントに届いているフォローリクエストの数
*/
Expand Down Expand Up @@ -562,7 +557,6 @@ export async function pack(
refuseFollow: !!db.refuseFollow,
autoAcceptFollowed: !!db.autoAcceptFollowed,
isExplorable: !!db.isExplorable,
disableblock: !!db.disableblock,
searchableBy: db.searchableBy || 'public',
hideFollows: db.hideFollows || '',

Expand Down
12 changes: 1 addition & 11 deletions src/server/api/endpoints/blocking/create.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import $ from 'cafy';
import ID, { transform } from '../../../../misc/cafy-id';
import * as ms from 'ms';
import { pack, isRemoteUser } from '../../../../models/user';
import { pack } from '../../../../models/user';
import Blocking from '../../../../models/blocking';
import create from '../../../../services/blocking/create';
import define from '../../define';
Expand Down Expand Up @@ -74,16 +74,6 @@ export default define(meta, async (ps, user) => {
throw e;
});

const accessDenied = {
message: 'Access denied.',
code: 'ACCESS_DENIED',
id: '56f35758-7dd5-468b-8439-5d6fb8ec9b8e'
};

if (blocker.disableblock && !isRemoteUser(blocker)) {
throw new ApiError(accessDenied, { reason: 'Block is disabled.' });
}

// Check if already blocking
const exist = await Blocking.findOne({
blockerId: blocker._id,
Expand Down
8 changes: 0 additions & 8 deletions src/server/api/endpoints/i/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,6 @@ export const meta = {
}
},

disableblock: {
validator: $.optional.bool,
desc: {
'ja-JP': 'disableblock'
}
},

searchableBy: {
validator: $.optional.nullable.str.or(['public', 'none']),
desc: {
Expand Down Expand Up @@ -314,7 +307,6 @@ export default define(meta, async (ps, user, app) => {
if (typeof ps.autoAcceptFollowed == 'boolean') updates.autoAcceptFollowed = ps.autoAcceptFollowed;
if (typeof ps.avoidSearchIndex == 'boolean') updates.avoidSearchIndex = ps.avoidSearchIndex;
if (typeof ps.isExplorable == 'boolean') updates.isExplorable = ps.isExplorable;
if (typeof ps.disableblock == 'boolean') updates.disableblock = ps.disableblock;
if (ps.searchableBy !== undefined) updates.searchableBy = ps.searchableBy;
if (ps.hideFollows !== undefined) updates.hideFollows = ps.hideFollows;
if (typeof ps.noFederation == 'boolean') updates.noFederation = ps.noFederation;
Expand Down
1 change: 0 additions & 1 deletion src/server/api/private/signup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ export default async (ctx: Router.RouterContext) => {
carefulMassive: true,
refuseFollow: false,
autoAcceptFollowed: true,
disableblock: true,
profile: {
bio: null,
birthday: null,
Expand Down

0 comments on commit da48056

Please sign in to comment.