From d4663922c75cbb05b89505a98f6cf70b8198e381 Mon Sep 17 00:00:00 2001 From: Dimitur Kirov Date: Tue, 26 Sep 2006 15:55:49 +0000 Subject: [PATCH] fix reconnect after name collision --- src/common/zeroconf/connection_zeroconf.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common/zeroconf/connection_zeroconf.py b/src/common/zeroconf/connection_zeroconf.py index f242e6611..36fc38b33 100644 --- a/src/common/zeroconf/connection_zeroconf.py +++ b/src/common/zeroconf/connection_zeroconf.py @@ -224,11 +224,11 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf): self.zeroconf.host = self.host self.zeroconf.port = self.port - if self.connection: - return self.connection, '' - if self.zeroconf.connect(): - self.connection = client_zeroconf.ClientZeroconf(self.zeroconf, self) + if not self.connection: + self.connection = client_zeroconf.ClientZeroconf(self.zeroconf, self) + else: + self.zeroconf.announce() self.roster = self.connection.getRoster() self.dispatch('ROSTER', self.roster) @@ -278,6 +278,7 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf): self.zeroconf.remove_announce() self.zeroconf.txt = txt2 self.zeroconf.port = port + self.zeroconf.username = self.username self.zeroconf.announce() def change_status(self, show, msg, sync = False, auto = False):