summaryrefslogtreecommitdiff
path: root/packages/backend/src/misc
diff options
context:
space:
mode:
authoranatawa12 <anatawa12@icloud.com>2023-10-30 13:48:22 +0900
committerGitHub <noreply@github.com>2023-10-30 13:48:22 +0900
commit7015cc937bd872e9c7ebafb56bdaea4ca138e0df (patch)
tree4cba42621dea7c76c4e8240d649202263710c7ba /packages/backend/src/misc
parentenhance(frontend): URL入力フォームのtypeをurlに (diff)
downloadmisskey-7015cc937bd872e9c7ebafb56bdaea4ca138e0df.tar.gz
misskey-7015cc937bd872e9c7ebafb56bdaea4ca138e0df.tar.bz2
misskey-7015cc937bd872e9c7ebafb56bdaea4ca138e0df.zip
fix(backend): We can renote pure renote (#12171)
* chore: make pure renote detection an function * fix: we can renote pure renote * docs(changelog): リノートをリノートできるのを修正 * fix: remaining debug log * chore: move isPureRenote to misc * chore: make isPureRenote type guard * chore: use isPureRenote in other places * fix CHANGELOG * style: fix lint --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'packages/backend/src/misc')
-rw-r--r--packages/backend/src/misc/is-pure-renote.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/backend/src/misc/is-pure-renote.ts b/packages/backend/src/misc/is-pure-renote.ts
new file mode 100644
index 0000000000..994d981522
--- /dev/null
+++ b/packages/backend/src/misc/is-pure-renote.ts
@@ -0,0 +1,10 @@
+import type { MiNote } from '@/models/Note.js';
+
+export function isPureRenote(note: MiNote): note is MiNote & { renoteId: NonNullable<MiNote['renoteId']> } {
+ if (!note.renoteId) return false;
+
+ if (note.text) return false; // it's quoted with text
+ if (note.fileIds.length !== 0) return false; // it's quoted with files
+ if (note.hasPoll) return false; // it's quoted with poll
+ return true;
+}