diff src/browser/sat_browser/register.py @ 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 3c5b17a3d86e
children f8a7a046ff9c
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):