summaryrefslogtreecommitdiff
path: root/packages/backend/src/core
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2024-11-17 09:31:17 -0500
committerHazelnoot <acomputerdog@gmail.com>2024-11-20 22:03:17 -0500
commitc9934c379fcaaf02511f7d3ba63be44306feb722 (patch)
treef556258cb3f14a8f31ca3d5852cc943655ecf002 /packages/backend/src/core
parentadd script to fix hellspawns (diff)
downloadsharkey-c9934c379fcaaf02511f7d3ba63be44306feb722.tar.gz
sharkey-c9934c379fcaaf02511f7d3ba63be44306feb722.tar.bz2
sharkey-c9934c379fcaaf02511f7d3ba63be44306feb722.zip
remove duplicate `isPureRenote` method
Diffstat (limited to 'packages/backend/src/core')
-rw-r--r--packages/backend/src/core/NoteCreateService.ts4
-rw-r--r--packages/backend/src/core/NoteEditService.ts9
2 files changed, 3 insertions, 10 deletions
diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts
index ccc5bc0214..892a929c41 100644
--- a/packages/backend/src/core/NoteCreateService.ts
+++ b/packages/backend/src/core/NoteCreateService.ts
@@ -146,7 +146,7 @@ type Option = {
app?: MiApp | null;
};
-type PureRenoteOption = Option & { renote: MiNote } & ({ text?: null } | { cw?: null } | { reply?: null } | { poll?: null } | { files?: null | [] });
+export type PureRenoteOption = Option & { renote: MiNote } & ({ text?: null } | { cw?: null } | { reply?: null } | { poll?: null } | { files?: null | [] });
@Injectable()
export class NoteCreateService implements OnApplicationShutdown {
@@ -824,7 +824,7 @@ export class NoteCreateService implements OnApplicationShutdown {
}
@bindThis
- private isPureRenote(note: Option): note is PureRenoteOption {
+ public isPureRenote(note: Option): note is PureRenoteOption {
return this.isRenote(note) && !this.isQuote(note);
}
diff --git a/packages/backend/src/core/NoteEditService.ts b/packages/backend/src/core/NoteEditService.ts
index 6c456fb4a3..e5e3c38cd3 100644
--- a/packages/backend/src/core/NoteEditService.ts
+++ b/packages/backend/src/core/NoteEditService.ts
@@ -142,8 +142,6 @@ type Option = {
editcount?: boolean | null;
};
-type PureRenoteOption = Option & { renote: MiNote } & ({ text?: null } | { cw?: null } | { reply?: null } | { poll?: null } | { files?: null | [] });
-
@Injectable()
export class NoteEditService implements OnApplicationShutdown {
#shutdownController = new AbortController();
@@ -444,7 +442,7 @@ export class NoteEditService implements OnApplicationShutdown {
if (user.host && !data.cw) {
await this.federatedInstanceService.fetch(user.host).then(async i => {
- if (i.isNSFW && !this.isPureRenote(data)) {
+ if (i.isNSFW && !this.noteCreateService.isPureRenote(data)) {
data.cw = 'Instance is marked as NSFW';
}
});
@@ -790,11 +788,6 @@ export class NoteEditService implements OnApplicationShutdown {
}
@bindThis
- private isPureRenote(note: Option): note is PureRenoteOption {
- return this.isRenote(note) && !this.isQuote(note);
- }
-
- @bindThis
private isRenote(note: Option): note is Option & { renote: MiNote } {
return note.renote != null;
}