Skip to content

Commit

Permalink
Fix default fallback of placeholder handling setting on entries
Browse files Browse the repository at this point in the history
Fixes #147
  • Loading branch information
luckyrat committed Jun 12, 2024
1 parent bc65cdb commit 6fd3031
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion KeePassRPC/KeePassRPCExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace KeePassRPC
public sealed class KeePassRPCExt : Plugin
{
// version information
public static readonly Version PluginVersion = new Version(2, 0, 1);
public static readonly Version PluginVersion = new Version(2, 0, 2);

public override string UpdateUrl
{
Expand Down
5 changes: 3 additions & 2 deletions KeePassRPC/KeePassRPCService.DTOV1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ private LightEntry GetEntryFromPwEntry(PwEntry pwe, EntryConfigv2 conf, int matc
}
}

if (ff.PlaceholderHandling == PlaceholderHandling.Enabled ||
(ff.PlaceholderHandling == PlaceholderHandling.Default &&
var fieldPlaceholderHandling = ff.PlaceholderHandling.GetValueOrDefault(PlaceholderHandling.Default);
if (fieldPlaceholderHandling == PlaceholderHandling.Enabled ||
(fieldPlaceholderHandling == PlaceholderHandling.Default &&
dbDefaultPlaceholderHandlingEnabled))
{
enablePlaceholders = true;
Expand Down
7 changes: 4 additions & 3 deletions KeePassRPC/KeePassRPCService.DTOV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ private LightEntry2 GetEntry2FromPwEntry(PwEntry pwe, EntryConfigv2 conf, int ma
{
if (!fullDetails && field.ValuePath != PwDefs.UserNameField)
continue;

bool enablePlaceholders = field.PlaceholderHandling == PlaceholderHandling.Enabled ||
(field.PlaceholderHandling == PlaceholderHandling.Default &&

var fieldPlaceholderHandling = field.PlaceholderHandling.GetValueOrDefault(PlaceholderHandling.Default);
bool enablePlaceholders = fieldPlaceholderHandling == PlaceholderHandling.Enabled ||
(fieldPlaceholderHandling == PlaceholderHandling.Default &&
dbDefaultPlaceholderHandlingEnabled);

string ffValue = field.ValuePath == "."
Expand Down
4 changes: 2 additions & 2 deletions KeePassRPC/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
[assembly: Guid("89631AAE-8DE6-4593-8DAB-AB28490A490A")]

// Assembly version information
[assembly: AssemblyVersion("2.0.1.0")]
[assembly: AssemblyFileVersion("2.0.1.0")] // also change AssemblyVersion and PluginVersion in KeePassRPCExt.cs!
[assembly: AssemblyVersion("2.0.2.0")]
[assembly: AssemblyFileVersion("2.0.2.0")] // also change AssemblyVersion and PluginVersion in KeePassRPCExt.cs!

0 comments on commit 6fd3031

Please sign in to comment.