comparison src/browser/sat_browser/menu.py @ 839:09ace5cbcb9b

browser (games, menu): rename showFailureRoomInvalid to onJoinMUCFailure and display a nice message when the room has already been joined (it is not a real error)
author souliane <souliane@mailoo.org>
date Wed, 13 Jan 2016 13:11:44 +0100
parents f8a7a046ff9c
children fd4eae654182
comparison
equal deleted inserted replaced
838:ab87da500820 839:09ace5cbcb9b
89 if self.host.whoami: 89 if self.host.whoami:
90 nick = self.host.whoami.node 90 nick = self.host.whoami.node
91 contact_list = self.host.contact_list 91 contact_list = self.host.contact_list
92 if room_jid is None or room_jid not in contact_list.getSpecials(C.CONTACT_SPECIAL_GROUP): 92 if room_jid is None or room_jid not in contact_list.getSpecials(C.CONTACT_SPECIAL_GROUP):
93 room_jid_s = unicode(room_jid) if room_jid else '' 93 room_jid_s = unicode(room_jid) if room_jid else ''
94 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) 94 self.host.bridge.joinMUC(room_jid_s, nick, profile=C.PROF_KEY_NONE, callback=lambda room_jid: invite(room_jid, contacts), errback=self.host.onJoinMUCFailure)
95 else: 95 else:
96 self.host.displayWidget(chat.Chat, room_jid, type_="group") 96 self.host.displayWidget(chat.Chat, room_jid, type_="group")
97 invite(room_jid, contacts) 97 invite(room_jid, contacts)
98 98
99 dialog.RoomAndContactsChooser(self.host, join, ok_button="Join", visible=(True, False)) 99 dialog.RoomAndContactsChooser(self.host, join, ok_button="Join", visible=(True, False))
101 101
102 # Help menu 102 # Help menu
103 103
104 def onOfficialChatRoom(self): 104 def onOfficialChatRoom(self):
105 nick = self.host.whoami.node 105 nick = self.host.whoami.node
106 self.host.bridge.joinMUC(self.host.default_muc, nick, profile=C.PROF_KEY_NONE, callback=lambda dummy: None, errback=self.host.showFailureRoomInvalid) 106 self.host.bridge.joinMUC(self.host.default_muc, nick, profile=C.PROF_KEY_NONE, callback=lambda dummy: None, errback=self.host.onJoinMUCFailure)
107 107
108 def onSocialContract(self): 108 def onSocialContract(self):
109 _frame = Frame('contrat_social.html') 109 _frame = Frame('contrat_social.html')
110 _frame.setStyleName('infoFrame') 110 _frame.setStyleName('infoFrame')
111 _dialog = dialog.GenericDialog("Contrat Social", _frame) 111 _dialog = dialog.GenericDialog("Contrat Social", _frame)