feat(sharkey): index-everything.patch

This commit is contained in:
alina 🌸 2024-05-24 14:10:28 +03:00
parent ecb2635a58
commit eeb53df81f
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI
2 changed files with 49 additions and 0 deletions

View file

@ -36,6 +36,8 @@ RUN git apply /patches/stats.patch
RUN git apply /patches/limits.patch
RUN git apply /patches/unfollow-notification.patch
RUN git apply /patches/webhook-notification.patch
# motivation: https://very.stupid.fish/notes/9shhrn2qncid008s
RUN git apply /patches/index-everything.patch
RUN cp -f /patches/robots.txt packages/backend/assets/robots.txt
# end patch

View file

@ -0,0 +1,47 @@
diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts
index 631d707..cf537fd 100644
--- a/packages/backend/src/core/NoteCreateService.ts
+++ b/packages/backend/src/core/NoteCreateService.ts
@@ -952,7 +952,7 @@ export class NoteCreateService implements OnApplicationShutdown {
}
// Register to search database
- if (!user.noindex) this.index(note);
+ this.index(note);
}
@bindThis
@@ -1051,7 +1051,7 @@ export class NoteCreateService implements OnApplicationShutdown {
}
// Register to search database
- if (!user.noindex) this.index(note);
+ this.index(note);
}
@bindThis
diff --git a/packages/backend/src/core/NoteEditService.ts b/packages/backend/src/core/NoteEditService.ts
index a01dfec..8fd3138 100644
--- a/packages/backend/src/core/NoteEditService.ts
+++ b/packages/backend/src/core/NoteEditService.ts
@@ -728,7 +728,7 @@ export class NoteEditService implements OnApplicationShutdown {
}
// Register to search database
- if (!user.noindex) this.index(note);
+ this.index(note);
}
@bindThis
diff --git a/packages/backend/src/core/SearchService.ts b/packages/backend/src/core/SearchService.ts
index 6dc3e85..087bd36 100644
--- a/packages/backend/src/core/SearchService.ts
+++ b/packages/backend/src/core/SearchService.ts
@@ -115,7 +115,6 @@ export class SearchService {
@bindThis
public async indexNote(note: MiNote): Promise<void> {
if (note.text == null && note.cw == null) return;
- if (!['home', 'public'].includes(note.visibility)) return;
if (this.meilisearch) {
switch (this.meilisearchIndexScope) {