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.
This commit is contained in:
parent
a8666e1508
commit
674b4f57d5
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue