raise is usefull to know if join was sucesfull or not (in roster_window.py). Fixes #6698

This commit is contained in:
Yann Leboulanger 2006-09-02 11:17:02 +00:00
parent cb555a148c
commit 7046a19af0
2 changed files with 13 additions and 4 deletions

View File

@ -1042,7 +1042,7 @@ class JoinGroupchatWindow:
jid = room + '@' + server
if jid in gajim.gc_connected[account] and gajim.gc_connected[account][jid]:
ErrorDialog(_('You are already in room %s') % jid)
return
raise RuntimeError, 'You are already in this room'
self.account = account
self.automatic = automatic
if nick == '':
@ -2144,7 +2144,10 @@ class InvitationReceivedDialog:
def on_accept_button_clicked(self, widget):
self.dialog.destroy()
room, server = gajim.get_room_name_and_server_from_room_jid(self.room_jid)
JoinGroupchatWindow(self.account, server = server, room = room)
try:
JoinGroupchatWindow(self.account, server = server, room = room)
except RuntimeError:
pass
class ProgressDialog:
def __init__(self, title_text, during_text, messages_queue):

View File

@ -1198,7 +1198,10 @@ class ToplevelAgentBrowser(AgentBrowser):
else:
room = ''
if not gajim.interface.instances[self.account].has_key('join_gc'):
dialogs.JoinGroupchatWindow(self.account, service, room)
try:
dialogs.JoinGroupchatWindow(self.account, service, room)
except RuntimeError:
pass
else:
gajim.interface.instances[self.account]['join_gc'].window.present()
self.window.destroy(chain = True)
@ -1528,7 +1531,10 @@ class MucBrowser(AgentBrowser):
else:
room = model[iter][1].decode('utf-8')
if not gajim.interface.instances[self.account].has_key('join_gc'):
dialogs.JoinGroupchatWindow(self.account, service, room)
try:
dialogs.JoinGroupchatWindow(self.account, service, room)
except RuntimeError:
pass
else:
gajim.interface.instances[self.account]['join_gc'].window.present()
self.window.destroy(chain = True)