Retract nickname from pubsub correctly

This commit is contained in:
Philipp Hörist 2017-08-08 19:58:20 +02:00
parent f3bdb596bd
commit c57af6dade
2 changed files with 2 additions and 2 deletions

View File

@ -836,8 +836,7 @@ class ConnectionPEP(object):
def retract_nickname(self): def retract_nickname(self):
if not self.pep_supported: if not self.pep_supported:
return return
self.send_nickname(None)
# not all client support new XEP, so we still retract
self._pubsub_connection.send_pb_retract('', nbxmpp.NS_NICK, '0') self._pubsub_connection.send_pb_retract('', nbxmpp.NS_NICK, '0')
def send_location(self, info): def send_location(self, info):

View File

@ -382,6 +382,7 @@ class ProfileWindow:
nick = vcard_['NICKNAME'] nick = vcard_['NICKNAME']
gajim.connections[self.account].send_nickname(nick) gajim.connections[self.account].send_nickname(nick)
if nick == '': if nick == '':
gajim.connections[self.account].retract_nickname()
nick = gajim.config.get_per('accounts', self.account, 'name') nick = gajim.config.get_per('accounts', self.account, 'name')
gajim.nicks[self.account] = nick gajim.nicks[self.account] = nick
gajim.connections[self.account].send_vcard(vcard_) gajim.connections[self.account].send_vcard(vcard_)