changeset 8b2649920d66 in /home/hg/repos/gajim
author: Yann Leboulanger asterix@lagaule.org branches: details:http://hg.gajim.org/gajim?cmd=changeset;node=8b2649920d66 description: don't crash when we cannot connect to avahi. Fixes #7607
diffstat:
src/common/zeroconf/connection_zeroconf.py | 1 + src/common/zeroconf/zeroconf_avahi.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-)
diffs (28 lines):
diff -r 816e8c24c6db -r 8b2649920d66 src/common/zeroconf/connection_zeroconf.py --- a/src/common/zeroconf/connection_zeroconf.py Wed Mar 26 18:23:58 2014 +0100 +++ b/src/common/zeroconf/connection_zeroconf.py Tue Dec 31 14:28:24 2013 +0100 @@ -296,6 +296,7 @@ show=show)) else: # show notification that avahi or system bus is down + self.connected = 0 gajim.nec.push_incoming_event(OurShowEvent(None, conn=self, show='offline')) self.status = 'offline' diff -r 816e8c24c6db -r 8b2649920d66 src/common/zeroconf/zeroconf_avahi.py --- a/src/common/zeroconf/zeroconf_avahi.py Wed Mar 26 18:23:58 2014 +0100 +++ b/src/common/zeroconf/zeroconf_avahi.py Tue Dec 31 14:28:24 2013 +0100 @@ -277,9 +277,10 @@
state = self.server.GetState() if state == self.avahi.SERVER_RUNNING: - self.create_service() - self.announced = True - return True + if self.create_service(): + self.announced = True + return True + return False
def remove_announce(self): if self.announced == False: