From 2096cd17362bd9e78222d332b3d7c6ffd155d4a0 Mon Sep 17 00:00:00 2001 From: Miquel Lionel Date: Tue, 15 Aug 2023 14:29:07 +0200 Subject: [PATCH] Obfuscate password length in account dialog (fixes #797) --- main/src/ui/manage_accounts/dialog.vala | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/main/src/ui/manage_accounts/dialog.vala b/main/src/ui/manage_accounts/dialog.vala index ab84c0991..022525dd6 100644 --- a/main/src/ui/manage_accounts/dialog.vala +++ b/main/src/ui/manage_accounts/dialog.vala @@ -45,10 +45,8 @@ public class Dialog : Gtk.Dialog { image_button.clicked.connect(show_select_avatar); alias_hybrid.entry.changed.connect(() => { selected_account.alias = alias_hybrid.text; }); password_hybrid.entry.changed.connect(() => { - string? pw_buffer; - pw_buffer = password_hybrid.text; - if (pw_buffer != null && pw_buffer.length > 0 && pw_buffer != "************") { - selected_account.password = pw_buffer; + if (password_hybrid.text != "************") { + selected_account.password = password_hybrid.text; } }); @@ -73,6 +71,7 @@ public class Dialog : Gtk.Dialog { settings_list.attach(widget, 1, row_index, 2); row_index++; + password_hybrid.text = "************"; } } @@ -205,7 +204,7 @@ public class Dialog : Gtk.Dialog { alias_hybrid.text = account.alias ?? ""; password_hybrid.entry.input_purpose = InputPurpose.PASSWORD; - password_hybrid.text = account.password; + update_status_label(account);