summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/NotePiningService.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-09-24 18:21:31 +0900
committerGitHub <noreply@github.com>2023-09-24 18:21:31 +0900
commitf32915b515f4cbc3b1a877cfb8e8e35bf6a31efa (patch)
tree0f6f098cbb282e4b6619152b14b9e6f57e6b448f /packages/backend/src/core/NotePiningService.ts
parentMerge pull request #11384 from misskey-dev/develop (diff)
parent2023.9.0 (diff)
downloadmisskey-f32915b515f4cbc3b1a877cfb8e8e35bf6a31efa.tar.gz
misskey-f32915b515f4cbc3b1a877cfb8e8e35bf6a31efa.tar.bz2
misskey-f32915b515f4cbc3b1a877cfb8e8e35bf6a31efa.zip
Merge pull request #11874 from misskey-dev/develop
Release: 2023.9.0
Diffstat (limited to 'packages/backend/src/core/NotePiningService.ts')
-rw-r--r--packages/backend/src/core/NotePiningService.ts21
1 files changed, 13 insertions, 8 deletions
diff --git a/packages/backend/src/core/NotePiningService.ts b/packages/backend/src/core/NotePiningService.ts
index 3a9f832ac0..147554ee9a 100644
--- a/packages/backend/src/core/NotePiningService.ts
+++ b/packages/backend/src/core/NotePiningService.ts
@@ -1,11 +1,16 @@
+/*
+ * SPDX-FileCopyrightText: syuilo and other misskey contributors
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
import { Inject, Injectable } from '@nestjs/common';
import { DI } from '@/di-symbols.js';
-import type { NotesRepository, UserNotePiningsRepository, UsersRepository } from '@/models/index.js';
+import type { NotesRepository, UserNotePiningsRepository, UsersRepository } from '@/models/_.js';
import { IdentifiableError } from '@/misc/identifiable-error.js';
-import type { User } from '@/models/entities/User.js';
-import type { Note } from '@/models/entities/Note.js';
+import type { MiUser } from '@/models/User.js';
+import type { MiNote } from '@/models/Note.js';
import { IdService } from '@/core/IdService.js';
-import type { UserNotePining } from '@/models/entities/UserNotePining.js';
+import type { MiUserNotePining } from '@/models/UserNotePining.js';
import { RelayService } from '@/core/RelayService.js';
import type { Config } from '@/config.js';
import { UserEntityService } from '@/core/entities/UserEntityService.js';
@@ -44,7 +49,7 @@ export class NotePiningService {
* @param noteId
*/
@bindThis
- public async addPinned(user: { id: User['id']; host: User['host']; }, noteId: Note['id']) {
+ public async addPinned(user: { id: MiUser['id']; host: MiUser['host']; }, noteId: MiNote['id']) {
// Fetch pinee
const note = await this.notesRepository.findOneBy({
id: noteId,
@@ -70,7 +75,7 @@ export class NotePiningService {
createdAt: new Date(),
userId: user.id,
noteId: note.id,
- } as UserNotePining);
+ } as MiUserNotePining);
// Deliver to remote followers
if (this.userEntityService.isLocalUser(user)) {
@@ -84,7 +89,7 @@ export class NotePiningService {
* @param noteId
*/
@bindThis
- public async removePinned(user: { id: User['id']; host: User['host']; }, noteId: Note['id']) {
+ public async removePinned(user: { id: MiUser['id']; host: MiUser['host']; }, noteId: MiNote['id']) {
// Fetch unpinee
const note = await this.notesRepository.findOneBy({
id: noteId,
@@ -107,7 +112,7 @@ export class NotePiningService {
}
@bindThis
- public async deliverPinnedChange(userId: User['id'], noteId: Note['id'], isAddition: boolean) {
+ public async deliverPinnedChange(userId: MiUser['id'], noteId: MiNote['id'], isAddition: boolean) {
const user = await this.usersRepository.findOneBy({ id: userId });
if (user == null) throw new Error('user not found');