raise is usefull to know if join was sucesfull or not (in roster_window.py). Fixes #6698
This commit is contained in:
parent
cb555a148c
commit
7046a19af0
|
@ -1042,7 +1042,7 @@ class JoinGroupchatWindow:
|
||||||
jid = room + '@' + server
|
jid = room + '@' + server
|
||||||
if jid in gajim.gc_connected[account] and gajim.gc_connected[account][jid]:
|
if jid in gajim.gc_connected[account] and gajim.gc_connected[account][jid]:
|
||||||
ErrorDialog(_('You are already in room %s') % jid)
|
ErrorDialog(_('You are already in room %s') % jid)
|
||||||
return
|
raise RuntimeError, 'You are already in this room'
|
||||||
self.account = account
|
self.account = account
|
||||||
self.automatic = automatic
|
self.automatic = automatic
|
||||||
if nick == '':
|
if nick == '':
|
||||||
|
@ -2144,7 +2144,10 @@ class InvitationReceivedDialog:
|
||||||
def on_accept_button_clicked(self, widget):
|
def on_accept_button_clicked(self, widget):
|
||||||
self.dialog.destroy()
|
self.dialog.destroy()
|
||||||
room, server = gajim.get_room_name_and_server_from_room_jid(self.room_jid)
|
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:
|
class ProgressDialog:
|
||||||
def __init__(self, title_text, during_text, messages_queue):
|
def __init__(self, title_text, during_text, messages_queue):
|
||||||
|
|
10
src/disco.py
10
src/disco.py
|
@ -1198,7 +1198,10 @@ class ToplevelAgentBrowser(AgentBrowser):
|
||||||
else:
|
else:
|
||||||
room = ''
|
room = ''
|
||||||
if not gajim.interface.instances[self.account].has_key('join_gc'):
|
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:
|
else:
|
||||||
gajim.interface.instances[self.account]['join_gc'].window.present()
|
gajim.interface.instances[self.account]['join_gc'].window.present()
|
||||||
self.window.destroy(chain = True)
|
self.window.destroy(chain = True)
|
||||||
|
@ -1528,7 +1531,10 @@ class MucBrowser(AgentBrowser):
|
||||||
else:
|
else:
|
||||||
room = model[iter][1].decode('utf-8')
|
room = model[iter][1].decode('utf-8')
|
||||||
if not gajim.interface.instances[self.account].has_key('join_gc'):
|
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:
|
else:
|
||||||
gajim.interface.instances[self.account]['join_gc'].window.present()
|
gajim.interface.instances[self.account]['join_gc'].window.present()
|
||||||
self.window.destroy(chain = True)
|
self.window.destroy(chain = True)
|
||||||
|
|
Loading…
Reference in New Issue