1
0
mirror of https://github.com/bitwarden/server synced 2025-12-17 08:43:27 +00:00

PM-10600: Sending to specific client types for relay push notifications

This commit is contained in:
Maciej Zieniuk
2024-10-22 10:29:11 +01:00
parent 3a604af0a4
commit 7020565770
3 changed files with 49 additions and 23 deletions

View File

@@ -72,15 +72,20 @@ public class PushController : Controller
{
CheckUsage();
if (!string.IsNullOrWhiteSpace(model.UserId))
if (model.Global)
{
await _pushNotificationService.SendPayloadToEveryoneAsync(model.Type, model.Payload,
Prefix(model.Identifier), Prefix(model.DeviceId), model.ClientType);
}
else if (!string.IsNullOrWhiteSpace(model.UserId))
{
await _pushNotificationService.SendPayloadToUserAsync(Prefix(model.UserId),
model.Type.Value, model.Payload, Prefix(model.Identifier), Prefix(model.DeviceId));
model.Type, model.Payload, Prefix(model.Identifier), Prefix(model.DeviceId), model.ClientType);
}
else if (!string.IsNullOrWhiteSpace(model.OrganizationId))
{
await _pushNotificationService.SendPayloadToOrganizationAsync(Prefix(model.OrganizationId),
model.Type.Value, model.Payload, Prefix(model.Identifier), Prefix(model.DeviceId));
model.Type, model.Payload, Prefix(model.Identifier), Prefix(model.DeviceId), model.ClientType);
}
}