Refactoring
This commit is contained in:
@@ -23,7 +23,9 @@ import registerHashtag from '../register-hashtag';
|
||||
import isQuote from '../../misc/is-quote';
|
||||
import { TextElementMention } from '../../mfm/parse/elements/mention';
|
||||
import { TextElementHashtag } from '../../mfm/parse/elements/hashtag';
|
||||
import { notesStats, perUserNotesStats } from '../stats';
|
||||
import notesChart from '../../chart/notes';
|
||||
import perUserNotesChart from '../../chart/per-user-notes';
|
||||
|
||||
import { erase, unique } from '../../prelude/array';
|
||||
import insertNoteUnread from './unread';
|
||||
|
||||
@@ -165,8 +167,8 @@ export default async (user: IUser, data: Option, silent = false) => new Promise<
|
||||
}
|
||||
|
||||
// 統計を更新
|
||||
notesStats.update(note, true);
|
||||
perUserNotesStats.update(user, note, true);
|
||||
notesChart.update(note, true);
|
||||
perUserNotesChart.update(user, note, true);
|
||||
|
||||
// ハッシュタグ登録
|
||||
tags.map(tag => registerHashtag(user, tag));
|
||||
|
@@ -6,7 +6,8 @@ import pack from '../../remote/activitypub/renderer';
|
||||
import { deliver } from '../../queue';
|
||||
import Following from '../../models/following';
|
||||
import renderTombstone from '../../remote/activitypub/renderer/tombstone';
|
||||
import { notesStats, perUserNotesStats } from '../stats';
|
||||
import notesChart from '../../chart/notes';
|
||||
import perUserNotesChart from '../../chart/per-user-notes';
|
||||
import config from '../../config';
|
||||
import NoteUnread from '../../models/note-unread';
|
||||
import read from './read';
|
||||
@@ -63,6 +64,6 @@ export default async function(user: IUser, note: INote) {
|
||||
//#endregion
|
||||
|
||||
// 統計を更新
|
||||
notesStats.update(note, false);
|
||||
perUserNotesStats.update(user, note, false);
|
||||
notesChart.update(note, false);
|
||||
perUserNotesChart.update(user, note, false);
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ import watch from '../watch';
|
||||
import renderLike from '../../../remote/activitypub/renderer/like';
|
||||
import { deliver } from '../../../queue';
|
||||
import pack from '../../../remote/activitypub/renderer';
|
||||
import { perUserReactionsStats } from '../../stats';
|
||||
import perUserReactionsChart from '../../../chart/per-user-reactions';
|
||||
|
||||
export default async (user: IUser, note: INote, reaction: string) => new Promise(async (res, rej) => {
|
||||
// Myself
|
||||
@@ -44,7 +44,7 @@ export default async (user: IUser, note: INote, reaction: string) => new Promise
|
||||
$inc: inc
|
||||
});
|
||||
|
||||
perUserReactionsStats.update(user, note);
|
||||
perUserReactionsChart.update(user, note);
|
||||
|
||||
publishNoteStream(note._id, 'reacted', {
|
||||
reaction: reaction,
|
||||
|
Reference in New Issue
Block a user