summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/NoteCreateService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/core/NoteCreateService.ts')
-rw-r--r--packages/backend/src/core/NoteCreateService.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts
index 3bfced1d80..8291db9b42 100644
--- a/packages/backend/src/core/NoteCreateService.ts
+++ b/packages/backend/src/core/NoteCreateService.ts
@@ -228,7 +228,7 @@ export class NoteCreateService implements OnApplicationShutdown {
}
@bindThis
- public async create(user: {
+ public async create(user: MiUser & {
id: MiUser['id'];
username: MiUser['username'];
host: MiUser['host'];
@@ -435,7 +435,7 @@ export class NoteCreateService implements OnApplicationShutdown {
}
@bindThis
- public async import(user: {
+ public async import(user: MiUser & {
id: MiUser['id'];
username: MiUser['username'];
host: MiUser['host'];
@@ -486,10 +486,10 @@ export class NoteCreateService implements OnApplicationShutdown {
// should really not happen, but better safe than sorry
if (data.reply?.id === insert.id) {
- throw new Error("A note can't reply to itself");
+ throw new Error('A note can\'t reply to itself');
}
if (data.renote?.id === insert.id) {
- throw new Error("A note can't renote itself");
+ throw new Error('A note can\'t renote itself');
}
if (data.uri != null) insert.uri = data.uri;
@@ -552,7 +552,7 @@ export class NoteCreateService implements OnApplicationShutdown {
}
@bindThis
- private async postNoteCreated(note: MiNote, user: {
+ private async postNoteCreated(note: MiNote, user: MiUser & {
id: MiUser['id'];
username: MiUser['username'];
host: MiUser['host'];
@@ -753,7 +753,7 @@ export class NoteCreateService implements OnApplicationShutdown {
//#region AP deliver
if (!data.localOnly && this.userEntityService.isLocalUser(user)) {
(async () => {
- const noteActivity = await this.renderNoteOrRenoteActivity(data, note);
+ const noteActivity = await this.renderNoteOrRenoteActivity(data, note, user);
const dm = this.apDeliverManagerService.createDeliverManager(user, noteActivity);
// メンションされたリモートユーザーに配送
@@ -899,12 +899,12 @@ export class NoteCreateService implements OnApplicationShutdown {
}
@bindThis
- private async renderNoteOrRenoteActivity(data: Option, note: MiNote) {
+ private async renderNoteOrRenoteActivity(data: Option, note: MiNote, user: MiUser) {
if (data.localOnly) return null;
const content = this.isRenote(data) && !this.isQuote(data)
? this.apRendererService.renderAnnounce(data.renote.uri ? data.renote.uri : `${this.config.url}/notes/${data.renote.id}`, note)
- : this.apRendererService.renderCreate(await this.apRendererService.renderNote(note, false), note);
+ : this.apRendererService.renderCreate(await this.apRendererService.renderNote(note, user, false), note);
return this.apRendererService.addContext(content);
}