summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/QueueService.ts
diff options
context:
space:
mode:
authoranatawa12 <anatawa12@icloud.com>2023-10-17 20:56:17 +0900
committerGitHub <noreply@github.com>2023-10-17 20:56:17 +0900
commit5a3c6575dd5d97dc0dc193771b80898fca4cfdc0 (patch)
tree010f40e4a961b888cb14bd34ed2fb9a88ad66a5f /packages/backend/src/core/QueueService.ts
parentupdate deps (diff)
downloadsharkey-5a3c6575dd5d97dc0dc193771b80898fca4cfdc0.tar.gz
sharkey-5a3c6575dd5d97dc0dc193771b80898fca4cfdc0.tar.bz2
sharkey-5a3c6575dd5d97dc0dc193771b80898fca4cfdc0.zip
新規にフォローした人のwithRepliesをtrueにする機能を追加 (#12048)
* feat: add defaultWithReplies to MiUser * feat: use defaultWithReplies when creating MiFollowing * feat: update defaultWithReplies from API * feat: return defaultWithReplies as a part of $i * feat(frontend): configure defaultWithReplies * docs(changelog): 新規にフォローした人のをデフォルトでTL二追加できるように * fix: typo * style: fix lint failure * chore: improve UI text * chore: make optional params of UserFollowingService.follow() object * chore: UserFollowingService.follow() accept withReplies * chore: add withReplies to MiFollowRequest * chore: process withReplies for follow request * feat: accept withReplies on 'following/create' endpoint * feat: store defaultWithReplies in client store * Revert "feat: return defaultWithReplies as a part of $i" This reverts commit f2cc4fe6 * Revert "feat: update defaultWithReplies from API" This reverts commit 95e3cee6 * Revert "feat: add defaultWithReplies to MiUser" This reverts commit 9f5ab14d7063532de2b049bc2ed40a15658168f5. * feat: configuring withReplies in import-following * feat(frontend): configure withReplies * fix(frontend): incorrectly showRepliesToOthersInTimeline can be shown * fix(backend): withReplies of following/create not working * fix(frontend): importFollowing error * fix: withReplies is not working with follow import * fix(frontend): use v-model * style: fix lint --------- Co-authored-by: Sayamame-beans <61457993+sayamame-beans@users.noreply.github.com> Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
Diffstat (limited to 'packages/backend/src/core/QueueService.ts')
-rw-r--r--packages/backend/src/core/QueueService.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/backend/src/core/QueueService.ts b/packages/backend/src/core/QueueService.ts
index d8c7250034..be378a899b 100644
--- a/packages/backend/src/core/QueueService.ts
+++ b/packages/backend/src/core/QueueService.ts
@@ -237,10 +237,11 @@ export class QueueService {
}
@bindThis
- public createImportFollowingJob(user: ThinUser, fileId: MiDriveFile['id']) {
+ public createImportFollowingJob(user: ThinUser, fileId: MiDriveFile['id'], withReplies?: boolean) {
return this.dbQueue.add('importFollowing', {
user: { id: user.id },
fileId: fileId,
+ withReplies,
}, {
removeOnComplete: true,
removeOnFail: true,
@@ -248,8 +249,8 @@ export class QueueService {
}
@bindThis
- public createImportFollowingToDbJob(user: ThinUser, targets: string[]) {
- const jobs = targets.map(rel => this.generateToDbJobData('importFollowingToDb', { user, target: rel }));
+ public createImportFollowingToDbJob(user: ThinUser, targets: string[], withReplies?: boolean) {
+ const jobs = targets.map(rel => this.generateToDbJobData('importFollowingToDb', { user, target: rel, withReplies }));
return this.dbQueue.addBulk(jobs);
}
@@ -342,7 +343,7 @@ export class QueueService {
}
@bindThis
- public createFollowJob(followings: { from: ThinUser, to: ThinUser, requestId?: string, silent?: boolean }[]) {
+ public createFollowJob(followings: { from: ThinUser, to: ThinUser, requestId?: string, silent?: boolean, withReplies?: boolean }[]) {
const jobs = followings.map(rel => this.generateRelationshipJobData('follow', rel));
return this.relationshipQueue.addBulk(jobs);
}
@@ -384,6 +385,7 @@ export class QueueService {
to: { id: data.to.id },
silent: data.silent,
requestId: data.requestId,
+ withReplies: data.withReplies,
},
opts: {
removeOnComplete: true,