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

Change password #1560

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

smalishevskiy
Copy link

@smalishevskiy smalishevskiy commented Mar 12, 2024

Fix issue #261

Fix problem with create XEP-0077. Implement more user frendly UI for change password

change_password

eerielili and others added 2 commits March 12, 2024 10:43
	- server refuses to responds in any way to the sent iq stanza
	  and i don't know why, when i send it with the xml console in
	  gajim it works well
@licaon-kter
Copy link
Contributor

If UI changes, do attach pics

@smalishevskiy
Copy link
Author

If UI changes, do attach pics

done

Copy link
Member

@fiaxh fiaxh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR!

Instead of using a Grid-Layout with Labels and Entries, I'd suggest to use Adw.PasswordEntryRow (within an Adw.PreferenceGroup, whithin an Adw.PreferencePage). It gives us some password field features for free and would look like this (this is from the gnome settings password change dialog):

image

Please remove updates to the .po and .pot files, they make PRs harder to review. We'll update the files independently afterwards.

We try to get rid of references to the StreamInteractor from our UI code, and I'd prefer to not introduce any more in the meanwhile. Could you please create a PasswordChangeDialogModel, that has a function to change the password (basically doing the StreamInteraction calls there instead of in the UI code)? The dialog UI code should contain a reference to the model and call the respective function there.

As a general style remark, you abbreviate variable names in various places (passwd, pw, chpw, btn, s, a, ...). We typically don't do that in our codebase and I'd like to keep the variable naming style at least somewhat consistent.

xmpp-vala/src/module/xep/0077_in_band_registration.vala Outdated Show resolved Hide resolved
Iq.Stanza chpw_result = yield stream.get_module(Iq.Module.IDENTITY).send_iq_async(stream, set_password_iq);
if (chpw_result.is_error()) {
ErrorStanza? error_stanza = chpw_result.get_error();
return error_stanza.text ?? "Error";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest to return the error condition instead. Unlike the text it has to exist and it allows us to display a localized error message of our choosing, also meaning it won't change depending on which server implementation the user uses.

[GtkChild] private unowned Entry confirm_new_passwd_entry;
[GtkChild] private unowned Label change_password_error_label;

private bool are_forms_empty;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is set but never read.

@smalishevskiy smalishevskiy marked this pull request as draft April 3, 2024 12:13
@smalishevskiy
Copy link
Author

We try to get rid of references to the StreamInteractor from our UI code, and I'd prefer to not introduce any more in the meanwhile. Could you please create a PasswordChangeDialogModel, that has a function to change the password (basically doing the StreamInteraction calls there instead of in the UI code)? The dialog UI code should contain a reference to the model and call the respective function there.

Can you point me example of model in current code? That is not clean for me where I should create the model's class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants