1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-08 03:23:23 +00:00

Hide email address in Sends (#1340)

* Add HideEmail model properties and locale strings

* Fix UI strings

* Add HideEmail to SendService

* Add HideEmail option to UI

* Tidy up declarations

* Add Bitwarden Send translation warning
This commit is contained in:
Thomas Rittson
2021-03-30 02:01:42 +10:00
committed by GitHub
parent 13ffbe911a
commit 04aeddc5de
12 changed files with 96 additions and 0 deletions

View File

@@ -9,5 +9,6 @@
RequireSso = 4, // Requires users to authenticate with SSO
PersonalOwnership = 5, // Disables personal vault ownership for adding/cloning items
DisableSend = 6, // Disables the ability to create and edit Sends
SendOptions = 7, // Sets restrictions or defaults for Bitwarden Sends
}
}

View File

@@ -24,6 +24,7 @@ namespace Bit.Core.Models.Data
DeletionDate = response.DeletionDate;
Password = response.Password;
Disabled = response.Disabled;
HideEmail = response.HideEmail.GetValueOrDefault();
switch (Type)
{
@@ -54,5 +55,6 @@ namespace Bit.Core.Models.Data
public DateTime DeletionDate { get; set; }
public string Password { get; set; }
public bool Disabled { get; set; }
public bool HideEmail { get; set; }
}
}

View File

@@ -27,6 +27,7 @@ namespace Bit.Core.Models.Domain
public DateTime DeletionDate { get; set; }
public string Password { get; set; }
public bool Disabled { get; set; }
public bool HideEmail { get; set; }
public Send() : base() { }
@@ -49,6 +50,7 @@ namespace Bit.Core.Models.Domain
RevisionDate = data.RevisionDate;
DeletionDate = data.DeletionDate;
ExpirationDate = data.ExpirationDate;
HideEmail = data.HideEmail;
switch (Type)
{

View File

@@ -19,6 +19,7 @@ namespace Bit.Core.Models.Request
public SendFileApi File { get; set; }
public string Password { get; set; }
public bool Disabled { get; set; }
public bool HideEmail { get; set; }
public SendRequest(Send send, long? fileLength)
{
@@ -32,6 +33,7 @@ namespace Bit.Core.Models.Request
Key = send.Key?.EncryptedString;
Password = send.Password;
Disabled = send.Disabled;
HideEmail = send.HideEmail;
switch (Type)
{

View File

@@ -21,5 +21,6 @@ namespace Bit.Core.Models.Response
public DateTime DeletionDate { get; set; }
public string Password { get; set; }
public bool Disabled { get; set; }
public bool? HideEmail { get; set; }
}
}

View File

@@ -21,6 +21,7 @@ namespace Bit.Core.Models.View
ExpirationDate = send.ExpirationDate;
Disabled = send.Disabled;
Password = send.Password;
HideEmail = send.HideEmail;
}
public string Id { get; set; }
@@ -45,5 +46,6 @@ namespace Bit.Core.Models.View
public bool Expired => ExpirationDate.HasValue && ExpirationDate.Value <= DateTime.UtcNow;
public bool PendingDelete => DeletionDate <= DateTime.UtcNow;
public string DisplayDate => DeletionDate.ToLocalTime().ToString("MMM d, yyyy, h:mm tt");
public bool HideEmail { get; set; }
}
}

View File

@@ -101,6 +101,7 @@ namespace Bit.Core.Services
Key = await _cryptoService.EncryptAsync(model.Key, key),
Name = await _cryptoService.EncryptAsync(model.Name, model.CryptoKey),
Notes = await _cryptoService.EncryptAsync(model.Notes, model.CryptoKey),
HideEmail = model.HideEmail
};
byte[] encryptedFileData = null;