[backend/masto-client] Don't deliver push notifications from blocked or muted notifiers (ISH-273)
This commit is contained in:
parent
b9fa870054
commit
bc1e695193
1 changed files with 11 additions and 0 deletions
|
@ -47,6 +47,17 @@ public class PushService(
|
||||||
if (subscriptions.Count == 0)
|
if (subscriptions.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
var skip = await db.Blockings.AnyAsync(p => p.Blocker == notification.Notifiee &&
|
||||||
|
p.Blockee == notification.Notifier) ||
|
||||||
|
await db.Mutings.AnyAsync(p => p.Muter == notification.Notifiee &&
|
||||||
|
p.Mutee == notification.Notifier);
|
||||||
|
|
||||||
|
if (skip)
|
||||||
|
{
|
||||||
|
// Notifier is blocked or muted, so we shouldn't deliver the notification
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
logger.LogDebug("Delivering mastodon push notification {id} for user {userId}", notification.Id,
|
logger.LogDebug("Delivering mastodon push notification {id} for user {userId}", notification.Id,
|
||||||
notification.Notifiee.Id);
|
notification.Notifiee.Id);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue