Commit 2a0bce4e authored by sb's avatar sb

don't attempt to do zeroconf things if avahi is not found,

display notification
parent d07dc398
......@@ -86,9 +86,18 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
gajim.config.set('usegpg', False)
self.avahi_error = False
import avahi
except ImportError:
self.avahi_error = True
if not self.avahi_error:
self.zeroconf = zeroconf.Zeroconf(self._on_new_service,
self._on_remove_service, self._on_name_conflictCB,
self._on_disconnected, self.username,, self.port)
self.muc_jid = {} # jid of muc server for each transport type
self.vcard_supported = False
......@@ -283,6 +292,14 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
check = True #to check for errors from zeroconf
if self.avahi_error:
self.dispatch('STATUS', 'offline')
self.status = 'offline'
(_('Could not connect "%s"') %,
_('Please check if avahi is installed.')))
# 'connect'
if show != 'offline' and not self.connected:
self.connect(None, show, msg)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment