Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(SecretAccountStore): workaround DONT_MATCH_NAME #742

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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