diff src/browser/sat_browser/menu.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 76a67d04c63e
line wrap: on
line diff
--- a/src/browser/sat_browser/menu.py	Mon Mar 30 10:28:47 2015 +0200
+++ b/src/browser/sat_browser/menu.py	Fri Mar 27 00:15:42 2015 +0100
@@ -78,19 +78,21 @@
         def invite(room_jid, contacts):
             for contact in contacts:
                 self.host.bridge.call('inviteMUC', None, unicode(contact), unicode(room_jid))
+
         def join(room_jid, contacts):
             if self.host.whoami:
                 nick = self.host.whoami.node
                 contact_list = self.host.contact_list
                 if room_jid is None or room_jid not in contact_list.getSpecials(C.CONTACT_SPECIAL_GROUP):
                     room_jid_s = unicode(room_jid) if room_jid else ''
-                    self.host.bridge.call('joinMUC', lambda room_jid: invite(room_jid, contacts), room_jid_s, nick)
+                    self.host.bridge.joinMUC(room_jid_s, nick, profile=C.PROF_KEY_NONE, callback=lambda room_jid: invite(room_jid, contacts), errback=self.host.showFailureRoomInvalid)
                 else:
                     self.host.displayWidget(chat.Chat, room_jid, type_="group", new_tab=room_jid)
                     invite(room_jid, contacts)
 
         dialog.RoomAndContactsChooser(self.host, join, ok_button="Join", visible=(True, False))
 
+
     # Help menu
 
     def onSocialContract(self):