summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/ApLogService.ts
diff options
context:
space:
mode:
authorJulia <julia@insertdomain.name>2025-05-29 00:07:38 +0000
committerJulia <julia@insertdomain.name>2025-05-29 00:07:38 +0000
commit6b554c178b81f13f83a69b19d44b72b282a0c119 (patch)
treef5537f1a56323a4dd57ba150b3cb84a2d8b5dc63 /packages/backend/src/core/ApLogService.ts
parentmerge: Security fixes (!970) (diff)
parentbump version for release (diff)
downloadsharkey-6b554c178b81f13f83a69b19d44b72b282a0c119.tar.gz
sharkey-6b554c178b81f13f83a69b19d44b72b282a0c119.tar.bz2
sharkey-6b554c178b81f13f83a69b19d44b72b282a0c119.zip
merge: release 2025.4.2 (!1051)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1051 Approved-by: Hazelnoot <acomputerdog@gmail.com> Approved-by: Marie <github@yuugi.dev> Approved-by: Julia <julia@insertdomain.name>
Diffstat (limited to 'packages/backend/src/core/ApLogService.ts')
-rw-r--r--packages/backend/src/core/ApLogService.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/packages/backend/src/core/ApLogService.ts b/packages/backend/src/core/ApLogService.ts
index 096ec21de7..f21c6da313 100644
--- a/packages/backend/src/core/ApLogService.ts
+++ b/packages/backend/src/core/ApLogService.ts
@@ -140,6 +140,24 @@ export class ApLogService {
}
/**
+ * Deletes all logged inbox activities from a user or users
+ * @param userIds IDs of the users to delete
+ */
+ public async deleteInboxLogs(userIds: string | string[]): Promise<number> {
+ if (Array.isArray(userIds)) {
+ const logsDeleted = await this.apInboxLogsRepository.delete({
+ authUserId: In(userIds),
+ });
+ return logsDeleted.affected ?? 0;
+ } else {
+ const logsDeleted = await this.apInboxLogsRepository.delete({
+ authUserId: userIds,
+ });
+ return logsDeleted.affected ?? 0;
+ }
+ }
+
+ /**
* Deletes all expired AP logs and garbage-collects the AP context cache.
* Returns the total number of deleted rows.
*/