Skip to content
Snippets Groups Projects
Commit 674b4f57 authored by jimpp's avatar jimpp
Browse files

Readd part of [8904] removed in [8938]. Then mix them. So we fix #3495/#3506...

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 a8666e15
No related branches found
No related tags found
No related merge requests found
...@@ -1537,9 +1537,18 @@ class GroupchatControl(ChatControlBase): ...@@ -1537,9 +1537,18 @@ class GroupchatControl(ChatControlBase):
_('The nickname has not allowed characters.')) _('The nickname has not allowed characters.'))
return return
gajim.connections[self.account].join_gc(nick, self.room_jid, None) 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, 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 minimize(self, status='offline'): def minimize(self, status='offline'):
# Minimize it # Minimize it
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment