changeset 804:1f054ba3245e

browser_side: fixes JID as login detection, can't rely on "@" keycode
author souliane <souliane@mailoo.org>
date Tue, 15 Dec 2015 13:04:20 +0100
parents 89a0cd2aa763
children f2a76ee020f6
files src/browser/sat_browser/register.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/browser/sat_browser/register.py	Thu Dec 10 13:30:27 2015 +0100
+++ b/src/browser/sat_browser/register.py	Tue Dec 15 13:04:20 2015 +0100
@@ -45,8 +45,6 @@
 from constants import Const as C
 
 
-KEY_AROBASE = 81  # XXX: this is the keycode for onKeyUp, the one which works for onKeyPress is 64!
-
 
 class RegisterPanel(FormPanel):
 
@@ -171,9 +169,9 @@
     def onKeyUp(self, sender, keycode, modifiers):
         # XXX: this is triggered after the textbox value has changed
         if sender == self.login_box:
-            if keycode == KEY_AROBASE:
+            if "@" in self.login_box.getText():
                 self.login_warning_msg.setHTML(_('<span class="formInfo">Entering a full JID is only needed to connect with an external XMPP account.</span>'))
-            elif "@" not in self.login_box.getText():
+            else:
                 self.login_warning_msg.setHTML("")
 
     def onKeyDown(self, sender, keycode, modifiers):