diff --git a/src/common/config.py b/src/common/config.py
index 0f8a2a00dbb6856ada14925581b0d743e1c77e65..da7cc93f1f6a843ab60ba5db86315ff6f27bb830 100644
--- a/src/common/config.py
+++ b/src/common/config.py
@@ -200,6 +200,7 @@ class Config:
 		'hide_groupchat_occupants_list': [opt_bool, False, _('Hides the room occupants list in groupchat window')],
 		'chat_merge_consecutive_nickname': [opt_bool, False, _('Merge consecutive nickname in chat window')],
 		'chat_merge_consecutive_nickname_indent': [opt_str, '  ', _('Indentation when using merge consecutive nickame')],
+		'zeroconf_enabled': [opt_bool, True, _('Enable zeroconf network')],
 	}
 
 	__options_per_key = {
diff --git a/src/common/zeroconf/connection_zeroconf.py b/src/common/zeroconf/connection_zeroconf.py
index 2a3fabfc7ae3e41cf7e19fced691952bb1c2e1ef..f8e091092c57ffb597c239bb56e47c2b2805a7c1 100644
--- a/src/common/zeroconf/connection_zeroconf.py
+++ b/src/common/zeroconf/connection_zeroconf.py
@@ -33,7 +33,7 @@ random.seed()
 import signal
 if os.name != 'nt':
 	signal.signal(signal.SIGPIPE, signal.SIG_DFL)
-
+import getpass
 import gobject
 
 from common import helpers
@@ -54,7 +54,6 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
 	def __init__(self, name):
 		ConnectionHandlersZeroconf.__init__(self)
 		self.name = name
-		self.zeroconf = zeroconf.Zeroconf(self._on_new_service, self._on_remove_service)
 		self.connected = 0 # offline
 		self.connection = None
 		self.gpg = None
@@ -74,7 +73,7 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
 		#self.last_history_line = {}
 
 		#we don't need a password, but must be non-empty
-		self.password = 'dummy'
+		self.password = 'zeroconf'
 
 		self.privacy_rules_supported = False
 		# Do we continue connection when we get roster (send presence,get vcard...)
@@ -89,10 +88,30 @@ class ConnectionZeroconf(ConnectionHandlersZeroconf):
 		self.on_connect_failure = None
 		self.retrycount = 0
 		self.jids_for_auto_auth = [] # list of jid to auto-authorize
+		self.get_config_values_or_default()
+
+	def get_config_values_or_default(self):
+		''' get name, host, port from config, or 
+		create zeroconf account with default values'''
+		if not gajim.config.get_per('accounts', 'zeroconf', 'name'):
+			print 'Creating zeroconf account'
+			gajim.config.add_per('accounts', 'zeroconf')
+			gajim.config.set_per('accounts', 'zeroconf', 'autoconnect', True)
+			gajim.config.set_per('accounts', 'zeroconf', 'password', 'zeroconf')
+			gajim.config.set_per('accounts', 'zeroconf', 'sync_with_global_status', True)
+			username = unicode(getpass.getuser())
+			gajim.config.set_per('accounts', 'zeroconf', 'name', username)
+			#XXX make sure host is US-ASCII
+			host = unicode(socket.gethostname())
+			gajim.config.set_per('accounts', 'zeroconf', 'hostname', host)
+			port = 5298
+			gajim.config.set_per('accounts', 'zeroconf', 'custom_port', 5298)
+		else:
+			username = gajim.config.get_per('accounts', 'zeroconf', 'name')
+			host = gajim.config.get_per('accounts', 'zeroconf', 'hostname')
+			port = gajim.config.get_per('accounts', 'zeroconf', 'custom_port')
+		self.zeroconf = zeroconf.Zeroconf(self._on_new_service, self._on_remove_service, username, host, port)
 
-		gajim.config.set_per('accounts', name, 'name', self.zeroconf.username)
-		gajim.config.set_per('accounts', name, 'hostname', self.zeroconf.host)
-		
 	# END __init__
 	def put_event(self, ev):
 		if gajim.handlers.has_key(ev[0]):
diff --git a/src/common/zeroconf/zeroconf.py b/src/common/zeroconf/zeroconf.py
index 20a40b7f5feda0f40aa5f73702c166b98e0ba867..5aa79315699a7d39066dd5507520ff0bdd09e760 100755
--- a/src/common/zeroconf/zeroconf.py
+++ b/src/common/zeroconf/zeroconf.py
@@ -1,8 +1,7 @@
 import os
 import sys
-import getpass
 import socket
-
+from common import gajim
 try:
 	import avahi, gobject, dbus
 except ImportError:
@@ -14,12 +13,12 @@ except ImportError, e:
 	pass
 
 class Zeroconf:
-	def __init__(self, new_serviceCB, remove_serviceCB):
+	def __init__(self, new_serviceCB, remove_serviceCB, name, host, port):
 		self.domain = None   # specific domain to browse
 		self.stype = '_presence._tcp'	
-		self.port = 5298  # listening port that gets announced	
-		self.username = getpass.getuser()
-		self.host = socket.gethostname()
+		self.port = port  # listening port that gets announced	
+		self.username = name
+		self.host = host
 		self.name = self.username+'@'+ self.host # service name
 		self.txt = {}		# service data
 		
@@ -37,7 +36,8 @@ class Zeroconf:
 		print "Error:", str(err)
 
 	def new_service_callback(self, interface, protocol, name, stype, domain, flags):
-		if name != self.name:
+		if True:
+		#XXX name != self.name
 			# print "Found service '%s' in domain '%s' on %i.%i." % (name, domain, interface, protocol)
 		
 			#synchronous resolving
@@ -183,9 +183,13 @@ class Zeroconf:
 		self.bus = dbus.SystemBus()
 		self.server = dbus.Interface(self.bus.get_object(avahi.DBUS_NAME, \
 			avahi.DBUS_PATH_SERVER), avahi.DBUS_INTERFACE_SERVER)
-
-		self.server.connect_to_signal('StateChanged', self.server_state_changed_callback)
-
+		try:
+			self.server.connect_to_signal('StateChanged', self.server_state_changed_callback)
+		except dbus.dbus_bindings.DBusException, e:
+			# Avahi service is not present
+			gajim.log.debug(str(e))
+			self.remove_announce()
+			return
 		# start browsing
 		if self.domain is None:
 			# Explicitly browse .local
diff --git a/src/gajim.py b/src/gajim.py
index 35de76b8b6ffe8f5d406af2a396fe131d76e3dcb..703a089f54d81fade06c3cbf79a27d19e344b38f 100755
--- a/src/gajim.py
+++ b/src/gajim.py
@@ -1739,10 +1739,10 @@ class Interface:
 			self.handle_event_file_progress)
 		gajim.proxy65_manager = proxy65_manager.Proxy65Manager(gajim.idlequeue)
 		self.register_handlers()
+		if gajim.config.get('zeroconf_enabled'):
+			gajim.connections['zeroconf'] = common.zeroconf.connection_zeroconf.ConnectionZeroconf('zeroconf')
 		for account in gajim.config.get_per('accounts'):
-			if account == 'zeroconf':
-				gajim.connections[account] = common.zeroconf.connection_zeroconf.ConnectionZeroconf(account)
-			else:
+			if account != 'zeroconf':
 				gajim.connections[account] = common.connection.Connection(account)
 		
 
diff --git a/src/tooltips.py b/src/tooltips.py
index cd41c22a99e675ea62795fb833b9b55cf22f4e3c..f09cccbdd53d877a53e12ba6024208bbb0c186be 100644
--- a/src/tooltips.py
+++ b/src/tooltips.py
@@ -508,7 +508,7 @@ class RosterTooltip(NotificationAreaTooltip):
 		vcard_table.set_homogeneous(False)
 		vcard_current_row = 1
 		properties = []
-		jid_markup = '<span weight="bold">' + unicode(prim_contact.jid) + '</span>'
+		jid_markup = '<span weight="bold">' + prim_contact.jid + '</span>'
 		properties.append((jid_markup, None))
 		properties.append((_('Name: '), gtkgui_helpers.escape_for_pango_markup(
 												prim_contact.get_shown_name())))