diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2025-04-01 20:47:04 -0400 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2025-04-01 20:47:04 -0400 |
| commit | 6ac37b4d6cae064545b13fd7fdb414d0cffa178b (patch) | |
| tree | 8e938baa2b15ccd233e91429d7f5ed7566ae3606 /packages/backend/src/core/ApLogService.ts | |
| parent | fix typo in check_connect.js (diff) | |
| download | sharkey-6ac37b4d6cae064545b13fd7fdb414d0cffa178b.tar.gz sharkey-6ac37b4d6cae064545b13fd7fdb414d0cffa178b.tar.bz2 sharkey-6ac37b4d6cae064545b13fd7fdb414d0cffa178b.zip | |
lint and type fixes
Diffstat (limited to 'packages/backend/src/core/ApLogService.ts')
| -rw-r--r-- | packages/backend/src/core/ApLogService.ts | 18 |
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. */ |