Commit 492acd22 authored by Yann Leboulanger's avatar Yann Leboulanger

[Jim] Readd part of [8904] removed in [8938]. Then mix them. So we fix...

[Jim] Readd part of [8904] removed in [8938]. Then mix them. So we fix #3495/#3506 and problem when connecting with an already used nick.
Fixes problem when we change nick with dialog to an already used one and then cancel. Fixes #3506.
parent 2f5f5b17
......@@ -1390,10 +1390,19 @@ class GroupchatControl(ChatControlBase):
_('The nickname has not allowed characters.'))
return
gajim.connections[self.account].join_gc(nick, self.room_jid, None)
self.nick = nick
if gajim.gc_connected[self.account][self.room_jid]:
# We are changing nick, we will change self.nick when we receive
# presence that inform that it works
self.new_nick = nick
else:
# We are connecting, we will not get a changed nick presence so
# change it NOW. We don't already have a nick so it's harmless
self.nick = nick
def on_cancel():
self.new_nick = ''
instance = dialogs.InputDialog(title, prompt, proposed_nick,
is_modal = False, ok_handler = on_ok)
is_modal = False, ok_handler = on_ok, cancel_handler = on_cancel)
def shutdown(self, status='offline'):
gajim.connections[self.account].send_gc_status(self.nick, self.room_jid,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment