summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2020-11-08 16:49:23 +0900
committersyuilo <syuilotan@yahoo.co.jp>2020-11-08 16:49:23 +0900
commit9d1fa3f20259cf7c303d49d5aae8e1fecdafc7ed (patch)
tree9bae26e351d3cc849b8f38823a3907e9e6b87d13
parentFix #6819 (diff)
downloadsharkey-9d1fa3f20259cf7c303d49d5aae8e1fecdafc7ed.tar.gz
sharkey-9d1fa3f20259cf7c303d49d5aae8e1fecdafc7ed.tar.bz2
sharkey-9d1fa3f20259cf7c303d49d5aae8e1fecdafc7ed.zip
autoWatch機能を削除
-rw-r--r--locales/ja-JP.yml2
-rw-r--r--migration/1604821689616-delete-auto-watch.ts14
-rw-r--r--src/client/pages/settings/notifications.vue15
-rw-r--r--src/models/entities/user-profile.ts5
-rw-r--r--src/models/repositories/user.ts1
-rw-r--r--src/server/api/endpoints/i/update.ts8
-rw-r--r--src/server/api/endpoints/notes/polls/vote.ts10
-rw-r--r--src/services/note/create.ts13
-rw-r--r--src/services/note/polls/vote.ts10
-rw-r--r--src/services/note/reaction/create.ts11
10 files changed, 17 insertions, 72 deletions
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index 5b16e35712..75b4b803d1 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -373,8 +373,6 @@ unregister: "登録を解除"
passwordLessLogin: "パスワード無しログイン"
resetPassword: "パスワードをリセット"
newPasswordIs: "新しいパスワードは「{password}」です"
-autoNoteWatch: "ノートの自動ウォッチ"
-autoNoteWatchDescription: "あなたがリアクションしたり返信したりした他のユーザーのノートに関する通知を受け取るようにします。"
reduceUiAnimation: "UIのアニメーションを減らす"
share: "共有"
notFound: "見つかりません"
diff --git a/migration/1604821689616-delete-auto-watch.ts b/migration/1604821689616-delete-auto-watch.ts
new file mode 100644
index 0000000000..e47a4cf1db
--- /dev/null
+++ b/migration/1604821689616-delete-auto-watch.ts
@@ -0,0 +1,14 @@
+import {MigrationInterface, QueryRunner} from "typeorm";
+
+export class deleteAutoWatch1604821689616 implements MigrationInterface {
+ name = 'deleteAutoWatch1604821689616'
+
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "autoWatch"`);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`ALTER TABLE "user_profile" ADD "autoWatch" boolean NOT NULL DEFAULT false`);
+ }
+
+}
diff --git a/src/client/pages/settings/notifications.vue b/src/client/pages/settings/notifications.vue
index 0b709a504b..ff0c276398 100644
--- a/src/client/pages/settings/notifications.vue
+++ b/src/client/pages/settings/notifications.vue
@@ -4,15 +4,6 @@
<MkButton full primary @click="configure"><Fa :icon="faCog"/> {{ $t('notificationSetting') }}</MkButton>
</div>
<div class="_section">
- <div class="_card">
- <div class="_content">
- <MkSwitch v-model:value="$store.state.i.autoWatch" @update:value="onChangeAutoWatch">
- {{ $t('autoNoteWatch') }}<template #desc>{{ $t('autoNoteWatchDescription') }}</template>
- </MkSwitch>
- </div>
- </div>
- </div>
- <div class="_section">
<MkButton full @click="readAllNotifications">{{ $t('markAsReadAllNotifications') }}</MkButton>
<MkButton full @click="readAllUnreadNotes">{{ $t('markAsReadAllUnreadNotes') }}</MkButton>
<MkButton full @click="readAllMessagingMessages">{{ $t('markAsReadAllTalkMessages') }}</MkButton>
@@ -52,12 +43,6 @@ export default defineComponent({
},
methods: {
- onChangeAutoWatch(v) {
- os.api('i/update', {
- autoWatch: v
- });
- },
-
readAllUnreadNotes() {
os.api('i/read-all-unread-notes');
},
diff --git a/src/models/entities/user-profile.ts b/src/models/entities/user-profile.ts
index 7195c20ffe..bd37da5ecc 100644
--- a/src/models/entities/user-profile.ts
+++ b/src/models/entities/user-profile.ts
@@ -109,11 +109,6 @@ export class UserProfile {
@Column('boolean', {
default: false,
})
- public autoWatch: boolean;
-
- @Column('boolean', {
- default: false,
- })
public autoAcceptFollowed: boolean;
@Column('boolean', {
diff --git a/src/models/repositories/user.ts b/src/models/repositories/user.ts
index 4ac7c6d85d..a334196832 100644
--- a/src/models/repositories/user.ts
+++ b/src/models/repositories/user.ts
@@ -235,7 +235,6 @@ export class UserRepository extends Repository<User> {
...(opts.detail && meId === user.id ? {
avatarId: user.avatarId,
bannerId: user.bannerId,
- autoWatch: profile!.autoWatch,
injectFeaturedNote: profile!.injectFeaturedNote,
alwaysMarkNsfw: profile!.alwaysMarkNsfw,
carefulBot: profile!.carefulBot,
diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts
index 2029f2b4b6..d3a8e0a8ce 100644
--- a/src/server/api/endpoints/i/update.ts
+++ b/src/server/api/endpoints/i/update.ts
@@ -120,13 +120,6 @@ export const meta = {
}
},
- autoWatch: {
- validator: $.optional.bool,
- desc: {
- 'ja-JP': '投稿の自動ウォッチをするか否か'
- }
- },
-
injectFeaturedNote: {
validator: $.optional.bool,
},
@@ -212,7 +205,6 @@ export default define(meta, async (ps, user, token) => {
if (typeof ps.carefulBot === 'boolean') profileUpdates.carefulBot = ps.carefulBot;
if (typeof ps.autoAcceptFollowed === 'boolean') profileUpdates.autoAcceptFollowed = ps.autoAcceptFollowed;
if (typeof ps.isCat === 'boolean') updates.isCat = ps.isCat;
- if (typeof ps.autoWatch === 'boolean') profileUpdates.autoWatch = ps.autoWatch;
if (typeof ps.injectFeaturedNote === 'boolean') profileUpdates.injectFeaturedNote = ps.injectFeaturedNote;
if (typeof ps.alwaysMarkNsfw === 'boolean') profileUpdates.alwaysMarkNsfw = ps.alwaysMarkNsfw;
diff --git a/src/server/api/endpoints/notes/polls/vote.ts b/src/server/api/endpoints/notes/polls/vote.ts
index 45210b5a6e..1e6ab472cc 100644
--- a/src/server/api/endpoints/notes/polls/vote.ts
+++ b/src/server/api/endpoints/notes/polls/vote.ts
@@ -1,6 +1,5 @@
import $ from 'cafy';
import { ID } from '../../../../../misc/cafy-id';
-import watch from '../../../../../services/note/watch';
import { publishNoteStream } from '../../../../../services/stream';
import { createNotification } from '../../../../../services/create-notification';
import define from '../../../define';
@@ -10,7 +9,7 @@ import { deliver } from '../../../../../queue';
import { renderActivity } from '../../../../../remote/activitypub/renderer';
import renderVote from '../../../../../remote/activitypub/renderer/vote';
import { deliverQuestionUpdate } from '../../../../../services/note/polls/update';
-import { PollVotes, NoteWatchings, Users, Polls, UserProfiles } from '../../../../../models';
+import { PollVotes, NoteWatchings, Users, Polls } from '../../../../../models';
import { Not } from 'typeorm';
import { IRemoteUser } from '../../../../../models/entities/user';
import { genId } from '../../../../../misc/gen-id';
@@ -152,13 +151,6 @@ export default define(meta, async (ps, user) => {
}
});
- const profile = await UserProfiles.findOne(user.id).then(ensure);
-
- // この投稿をWatchする
- if (profile.autoWatch !== false) {
- watch(user.id, note);
- }
-
// リモート投票の場合リプライ送信
if (note.userHost != null) {
const pollOwner = await Users.findOne(note.userId).then(ensure) as IRemoteUser;
diff --git a/src/services/note/create.ts b/src/services/note/create.ts
index c8e3db540d..f6593996e9 100644
--- a/src/services/note/create.ts
+++ b/src/services/note/create.ts
@@ -5,7 +5,6 @@ import renderNote from '../../remote/activitypub/renderer/note';
import renderCreate from '../../remote/activitypub/renderer/create';
import renderAnnounce from '../../remote/activitypub/renderer/announce';
import { renderActivity } from '../../remote/activitypub/renderer';
-import watch from './watch';
import { parse } from '../../mfm/parse';
import { resolveUser } from '../../remote/resolve-user';
import config from '../../config';
@@ -340,18 +339,11 @@ export default async (user: User, data: Option, silent = false) => new Promise<N
await createMentionedEvents(mentionedUsers, note, nm);
- const profile = await UserProfiles.findOne(user.id).then(ensure);
-
// If has in reply to note
if (data.reply) {
// Fetch watchers
nmRelatedPromises.push(notifyToWatchersOfReplyee(data.reply, user, nm));
- // この投稿をWatchする
- if (Users.isLocalUser(user) && profile.autoWatch) {
- watch(user.id, data.reply);
- }
-
// 通知
if (data.reply.userHost === null) {
nm.push(data.reply.userId, 'reply');
@@ -371,11 +363,6 @@ export default async (user: User, data: Option, silent = false) => new Promise<N
// Fetch watchers
nmRelatedPromises.push(notifyToWatchersOfRenotee(data.renote, user, nm, type));
- // この投稿をWatchする
- if (Users.isLocalUser(user) && profile.autoWatch) {
- watch(user.id, data.renote);
- }
-
// Publish event
if ((user.id !== data.renote.userId) && data.renote.userHost === null) {
publishMainStream(data.renote.userId, 'renote', noteObj);
diff --git a/src/services/note/polls/vote.ts b/src/services/note/polls/vote.ts
index 7350c813af..bfcaaa09be 100644
--- a/src/services/note/polls/vote.ts
+++ b/src/services/note/polls/vote.ts
@@ -1,8 +1,7 @@
-import watch from '../../../services/note/watch';
import { publishNoteStream } from '../../stream';
import { User } from '../../../models/entities/user';
import { Note } from '../../../models/entities/note';
-import { PollVotes, Users, NoteWatchings, Polls, UserProfiles } from '../../../models';
+import { PollVotes, NoteWatchings, Polls } from '../../../models';
import { Not } from 'typeorm';
import { genId } from '../../../misc/gen-id';
import { createNotification } from '../../create-notification';
@@ -68,11 +67,4 @@ export default async function(user: User, note: Note, choice: number) {
});
}
});
-
- const profile = await UserProfiles.findOne(user.id);
-
- // ローカルユーザーが投票した場合この投稿をWatchする
- if (Users.isLocalUser(user) && profile!.autoWatch) {
- watch(user.id, note);
- }
}
diff --git a/src/services/note/reaction/create.ts b/src/services/note/reaction/create.ts
index bfa95b087b..adc96ddc1f 100644
--- a/src/services/note/reaction/create.ts
+++ b/src/services/note/reaction/create.ts
@@ -1,13 +1,11 @@
import { publishNoteStream } from '../../stream';
-import watch from '../watch';
import { renderLike } from '../../../remote/activitypub/renderer/like';
import DeliverManager from '../../../remote/activitypub/deliver-manager';
import { renderActivity } from '../../../remote/activitypub/renderer';
-import { IdentifiableError } from '../../../misc/identifiable-error';
import { toDbReaction, decodeReaction } from '../../../misc/reaction-lib';
import { User, IRemoteUser } from '../../../models/entities/user';
import { Note } from '../../../models/entities/note';
-import { NoteReactions, Users, NoteWatchings, Notes, UserProfiles, Emojis } from '../../../models';
+import { NoteReactions, Users, NoteWatchings, Notes, Emojis } from '../../../models';
import { Not } from 'typeorm';
import { perUserReactionsChart } from '../../chart';
import { genId } from '../../../misc/gen-id';
@@ -101,13 +99,6 @@ export default async (user: User, note: Note, reaction?: string) => {
}
});
- const profile = await UserProfiles.findOne(user.id);
-
- // ユーザーがローカルユーザーかつ自動ウォッチ設定がオンならばこの投稿をWatchする
- if (Users.isLocalUser(user) && profile!.autoWatch) {
- watch(user.id, note);
- }
-
//#region 配信
if (Users.isLocalUser(user) && !note.localOnly) {
const content = renderActivity(await renderLike(inserted, note));