diff options
| author | dakkar <dakkar@thenautilus.net> | 2024-08-18 18:32:27 +0000 |
|---|---|---|
| committer | dakkar <dakkar@thenautilus.net> | 2024-08-18 18:32:27 +0000 |
| commit | f5560783ea24eda75edc1223daa3c1690204fd9f (patch) | |
| tree | 9f30d06979bcd45522bbbf154efbbd082f4356bf /packages/backend/src/queue/processors/EndedPollNotificationProcessorService.ts | |
| parent | merge: make the cap of `activeRateLimitRequests` match the rate limit (!602) (diff) | |
| parent | Merge branch 'develop' into feature/misskey-2024.07 (diff) | |
| download | sharkey-f5560783ea24eda75edc1223daa3c1690204fd9f.tar.gz sharkey-f5560783ea24eda75edc1223daa3c1690204fd9f.tar.bz2 sharkey-f5560783ea24eda75edc1223daa3c1690204fd9f.zip | |
merge: misskey 2024.7 (!583)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/583
Approved-by: Marie <github@yuugi.dev>
Approved-by: Julia Johannesen <julia@insertdomain.name>
Diffstat (limited to 'packages/backend/src/queue/processors/EndedPollNotificationProcessorService.ts')
| -rw-r--r-- | packages/backend/src/queue/processors/EndedPollNotificationProcessorService.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/backend/src/queue/processors/EndedPollNotificationProcessorService.ts b/packages/backend/src/queue/processors/EndedPollNotificationProcessorService.ts index 29c1f27bb1..34180e5f2b 100644 --- a/packages/backend/src/queue/processors/EndedPollNotificationProcessorService.ts +++ b/packages/backend/src/queue/processors/EndedPollNotificationProcessorService.ts @@ -7,6 +7,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; import type { PollVotesRepository, NotesRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; +import { CacheService } from '@/core/CacheService.js'; import { NotificationService } from '@/core/NotificationService.js'; import { bindThis } from '@/decorators.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; @@ -24,6 +25,7 @@ export class EndedPollNotificationProcessorService { @Inject(DI.pollVotesRepository) private pollVotesRepository: PollVotesRepository, + private cacheService: CacheService, private notificationService: NotificationService, private queueLoggerService: QueueLoggerService, ) { @@ -47,9 +49,12 @@ export class EndedPollNotificationProcessorService { const userIds = [...new Set([note.userId, ...votes.map(v => v.userId)])]; for (const userId of userIds) { - this.notificationService.createNotification(userId, 'pollEnded', { - noteId: note.id, - }); + const profile = await this.cacheService.userProfileCache.fetch(userId); + if (profile.userHost === null) { + this.notificationService.createNotification(userId, 'pollEnded', { + noteId: note.id, + }); + } } } } |