mirror of
https://github.com/bitwarden/server
synced 2025-12-12 14:23:38 +00:00
send collection ids with cipher notification
This commit is contained in:
@@ -7,6 +7,7 @@ using Bit.Core.Models;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Net.Http;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Bit.Core.Services
|
||||
{
|
||||
@@ -36,22 +37,22 @@ namespace Bit.Core.Services
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
}
|
||||
|
||||
public async Task PushSyncCipherCreateAsync(Cipher cipher)
|
||||
public async Task PushSyncCipherCreateAsync(Cipher cipher, IEnumerable<Guid> collectionIds)
|
||||
{
|
||||
await PushCipherAsync(cipher, PushType.SyncCipherCreate);
|
||||
await PushCipherAsync(cipher, PushType.SyncCipherCreate, collectionIds);
|
||||
}
|
||||
|
||||
public async Task PushSyncCipherUpdateAsync(Cipher cipher)
|
||||
public async Task PushSyncCipherUpdateAsync(Cipher cipher, IEnumerable<Guid> collectionIds)
|
||||
{
|
||||
await PushCipherAsync(cipher, PushType.SyncCipherUpdate);
|
||||
await PushCipherAsync(cipher, PushType.SyncCipherUpdate, collectionIds);
|
||||
}
|
||||
|
||||
public async Task PushSyncCipherDeleteAsync(Cipher cipher)
|
||||
{
|
||||
await PushCipherAsync(cipher, PushType.SyncLoginDelete);
|
||||
await PushCipherAsync(cipher, PushType.SyncLoginDelete, null);
|
||||
}
|
||||
|
||||
private async Task PushCipherAsync(Cipher cipher, PushType type)
|
||||
private async Task PushCipherAsync(Cipher cipher, PushType type, IEnumerable<Guid> collectionIds)
|
||||
{
|
||||
if(cipher.OrganizationId.HasValue)
|
||||
{
|
||||
@@ -60,6 +61,7 @@ namespace Bit.Core.Services
|
||||
Id = cipher.Id,
|
||||
OrganizationId = cipher.OrganizationId,
|
||||
RevisionDate = cipher.RevisionDate,
|
||||
CollectionIds = collectionIds,
|
||||
};
|
||||
|
||||
await SendMessageAsync(type, message, true);
|
||||
|
||||
Reference in New Issue
Block a user