summaryrefslogtreecommitdiff
path: root/packages/backend/src/queue/processors
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/queue/processors
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/queue/processors')
-rw-r--r--packages/backend/src/queue/processors/ImportFollowingProcessorService.ts6
-rw-r--r--packages/backend/src/queue/processors/RelationshipProcessorService.ts8
2 files changed, 9 insertions, 5 deletions
diff --git a/packages/backend/src/queue/processors/ImportFollowingProcessorService.ts b/packages/backend/src/queue/processors/ImportFollowingProcessorService.ts
index 2b5e41a12d..e75499a56f 100644
--- a/packages/backend/src/queue/processors/ImportFollowingProcessorService.ts
+++ b/packages/backend/src/queue/processors/ImportFollowingProcessorService.ts
@@ -56,7 +56,7 @@ export class ImportFollowingProcessorService {
const csv = await this.downloadService.downloadTextFile(file.url);
const targets = csv.trim().split('\n');
- this.queueService.createImportFollowingToDbJob({ id: user.id }, targets);
+ this.queueService.createImportFollowingToDbJob({ id: user.id }, targets, job.data.withReplies);
this.logger.succ('Import jobs created');
}
@@ -93,9 +93,9 @@ export class ImportFollowingProcessorService {
// skip myself
if (target.id === job.data.user.id) return;
- this.logger.info(`Follow ${target.id} ...`);
+ this.logger.info(`Follow ${target.id} ${job.data.withReplies ? 'with replies' : 'without replies'} ...`);
- this.queueService.createFollowJob([{ from: user, to: { id: target.id }, silent: true }]);
+ this.queueService.createFollowJob([{ from: user, to: { id: target.id }, silent: true, withReplies: job.data.withReplies }]);
} catch (e) {
this.logger.warn(`Error: ${e}`);
}
diff --git a/packages/backend/src/queue/processors/RelationshipProcessorService.ts b/packages/backend/src/queue/processors/RelationshipProcessorService.ts
index 5b2d2ef313..b2d8e3631f 100644
--- a/packages/backend/src/queue/processors/RelationshipProcessorService.ts
+++ b/packages/backend/src/queue/processors/RelationshipProcessorService.ts
@@ -34,8 +34,12 @@ export class RelationshipProcessorService {
@bindThis
public async processFollow(job: Bull.Job<RelationshipJobData>): Promise<string> {
- this.logger.info(`${job.data.from.id} is trying to follow ${job.data.to.id}`);
- await this.userFollowingService.follow(job.data.from, job.data.to, job.data.requestId, job.data.silent);
+ this.logger.info(`${job.data.from.id} is trying to follow ${job.data.to.id} ${job.data.withReplies ? "with replies" : "without replies"}`);
+ await this.userFollowingService.follow(job.data.from, job.data.to, {
+ requestId: job.data.requestId,
+ silent: job.data.silent,
+ withReplies: job.data.withReplies,
+ });
return 'ok';
}