Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
eb5ce03b by wurstsalat at 2023-01-29T15:14:01+01:00
imprv: Account wizard: Don't allow to add account twice

- - - - -


1 changed file:

- gajim/gtk/account_wizard.py


Changes:

=====================================
gajim/gtk/account_wizard.py
=====================================
@@ -664,6 +664,16 @@ def _validate_jid(self, address: str) -> bool:
                 Gtk.EntryIconPosition.SECONDARY, _('Invalid Address'))
             return False
 
+        for account in app.settings.get_accounts():
+            name = app.settings.get_account_setting(account, 'name')
+            hostname = app.settings.get_account_setting(account, 'hostname')
+            if address == f'{name}@{hostname}':
+                self._show_icon(True)
+                self._ui.log_in_address_entry.set_icon_tooltip_text(
+                    Gtk.EntryIconPosition.SECONDARY,
+                    _('This account has already been added'))
+                return False
+
         self._show_icon(False)
         return True
 



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/eb5ce03b3512e8e8b412250128d3a9664dc4387d

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/eb5ce03b3512e8e8b412250128d3a9664dc4387d
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to