don't crash when we cannot connect to avahi. Fixes #7607

This commit is contained in:
Yann Leboulanger 2013-12-31 14:28:24 +01:00
parent 3cbb9df77b
commit 309e7caf8a
2 changed files with 5 additions and 3 deletions

View File

@ -296,6 +296,7 @@ class ConnectionZeroconf(CommonConnection, ConnectionHandlersZeroconf):
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'

View File

@ -277,9 +277,10 @@ class Zeroconf:
state = self.server.GetState()
if state == self.avahi.SERVER_RUNNING:
self.create_service()
if self.create_service():
self.announced = True
return True
return False
def remove_announce(self):
if self.announced == False: