autoWatch機能を削除
This commit is contained in:
parent
a6985d7dc7
commit
9d1fa3f202
10 changed files with 17 additions and 72 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue