diff src/browser/sat_browser/dialog.py @ 686:90a5a5af2550

browser_side: let the backend check for the validity of MUC JIDs that come from a user input
author souliane <souliane@mailoo.org>
date Fri, 27 Mar 2015 00:15:42 +0100
parents 9877607c719a
children 7a9c7b9f6a28
line wrap: on
line diff
--- a/src/browser/sat_browser/dialog.py	Mon Mar 30 10:28:47 2015 +0200
+++ b/src/browser/sat_browser/dialog.py	Fri Mar 27 00:15:42 2015 +0100
@@ -21,7 +21,6 @@
 log = getLogger(__name__)
 
 from constants import Const as C
-from sat_frontends.tools.misc import DEFAULT_MUC
 from sat_frontends.tools import jid
 
 from pyjamas.ui.VerticalPanel import VerticalPanel
@@ -55,7 +54,7 @@
 
     GENERATE_MUC = "<use random name>"
 
-    def __init__(self, host, default_room=DEFAULT_MUC):
+    def __init__(self, host, default_room=C.DEFAULT_MUC):
         """
 
         @param host (SatWebFrontend)
@@ -204,7 +203,7 @@
         button_panel.add(ok_button)
         button_panel.add(Button("Cancel", self.onCancel))
 
-        self.room_panel = RoomChooser(host, "" if visible == (False, True) else DEFAULT_MUC)
+        self.room_panel = RoomChooser(host, "" if visible == (False, True) else C.DEFAULT_MUC)
         self.contact_panel = ContactsChooser(host, nb_contact, ok_button)
 
         self.stack_panel = base_panel.ToggleStackPanel(Width="100%")
@@ -263,9 +262,6 @@
 
     def onOK(self, sender):
         room = self.room  # pyjamas issue: you need to use an intermediate variable to access a property's method
-        if room and not room.is_valid():
-            Window.alert('You must enter a room jid in the form room@chat.%s' % self.host._defaultDomain)
-            return
         self.hide()
         self.callback(room, self.contacts)