Skip to content

Commit

Permalink
fix(SecretAccountStore): workaround DONT_MATCH_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
GeopJr committed Jan 10, 2024
1 parent 59d36a9 commit 1773f51
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/Services/Accounts/SecretAccountStore.vala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class Tuba.SecretAccountStore : AccountStore {
schema_attributes["version"] = Secret.SchemaAttributeType.STRING;
schema = new Secret.Schema.newv (
Build.DOMAIN,
Secret.SchemaFlags.NONE,
Secret.SchemaFlags.DONT_MATCH_NAME,
schema_attributes
);

Expand Down Expand Up @@ -61,6 +61,19 @@ public class Tuba.SecretAccountStore : AccountStore {
}

secrets.foreach (item => {
// HACK for DONT_MATCH_NAME
// https://github.com/GeopJr/Tuba/pull/701
// "Mastodon Account" is not meant to be static
// and might be affected by translations, so
// just keep it as a fallback if xdg:schema
// is not available

bool skip_secret = item.label != _("Mastodon Account");
if (item.attributes.contains ("xdg:schema")) {
skip_secret = item.attributes.get ("xdg:schema") != Build.DOMAIN;
}
if (skip_secret) return;

// TODO: remove uuid fallback
bool force_save = false;
var account = secret_to_account (item, out force_save);
Expand Down

0 comments on commit 1773f51

Please sign in to comment.