mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-25 05:29:07 +01:00
94228778c9
* wip * wip * fix * clean up * Update tsconfig.json * Update activitypub.ts * wip
21 lines
551 B
TypeScript
21 lines
551 B
TypeScript
import { User } from '@/models/entities/user.js';
|
|
import { Note } from '@/models/entities/note.js';
|
|
import { NoteWatchings } from '@/models/index.js';
|
|
import { genId } from '@/misc/gen-id.js';
|
|
import { NoteWatching } from '@/models/entities/note-watching.js';
|
|
|
|
export default async (me: User['id'], note: Note) => {
|
|
// 自分の投稿はwatchできない
|
|
if (me === note.userId) {
|
|
return;
|
|
}
|
|
|
|
await NoteWatchings.insert({
|
|
id: genId(),
|
|
createdAt: new Date(),
|
|
noteId: note.id,
|
|
userId: me,
|
|
noteUserId: note.userId,
|
|
} as NoteWatching);
|
|
};
|