diff --git a/data/other/servers.xml b/data/other/servers.xml
index 0a044c1c2..19a00c236 100644
--- a/data/other/servers.xml
+++ b/data/other/servers.xml
@@ -369,4 +369,10 @@
-
-
\ No newline at end of file
+ -
+
+
+ -
+
+
+
diff --git a/src/common/configpaths.py b/src/common/configpaths.py
index d3c188607..daead7794 100644
--- a/src/common/configpaths.py
+++ b/src/common/configpaths.py
@@ -87,7 +87,7 @@ def init():
paths.add_from_root(n, p)
paths.add('DATA', os.path.join(u'..', windowsify(u'data')))
- paths.add('HOME', os.path.expanduser(u'~'))
+ paths.add('HOME', fse(os.path.expanduser('~')))
paths.add('TMP', fse(tempfile.gettempdir()))
try:
diff --git a/src/common/connection.py b/src/common/connection.py
index 42d405c9f..606725a6b 100644
--- a/src/common/connection.py
+++ b/src/common/connection.py
@@ -109,6 +109,8 @@ class Connection(ConnectionHandlers):
self.time_to_reconnect = None
if self.connected < 2: #connection failed
gajim.log.debug('reconnect')
+ self.connected = 1
+ self.dispatch('STATUS', 'connecting')
self.retrycount += 1
signed = self.get_signed_msg(self.status)
self.on_connect_auth = self._init_roster
@@ -143,8 +145,8 @@ class Connection(ConnectionHandlers):
if not self.on_purpose:
self.disconnect()
if gajim.config.get_per('accounts', self.name, 'autoreconnect'):
- self.connected = 1
- self.dispatch('STATUS', 'connecting')
+ self.connected = -1
+ self.dispatch('STATUS', 'error')
# this check has moved from _reconnect method
# do exponential backoff until 15 minutes,
# then small linear increase
@@ -154,7 +156,7 @@ class Connection(ConnectionHandlers):
self.last_time_to_reconnect *= 1.5
self.last_time_to_reconnect += randomsource.randint(0, 5)
self.time_to_reconnect = int(self.last_time_to_reconnect)
- gajim.log.debug("Reconnect to %s in %ss", self.name, self.time_to_reconnect)
+ gajim.log.info("Reconnect to %s in %ss", self.name, self.time_to_reconnect)
gajim.idlequeue.set_alarm(self._reconnect_alarm,
self.time_to_reconnect)
elif self.on_connect_failure:
@@ -379,11 +381,13 @@ class Connection(ConnectionHandlers):
if self.on_connect_success == self._on_new_account:
con.RegisterDisconnectHandler(self._on_new_account)
+ gajim.log.info("Connecting to %s: [%s:%d]", self.name, host['host'], host['port'])
con.connect((host['host'], host['port']), proxy = self._proxy,
secure = self._secure)
return
else:
if not retry and self.retrycount == 0:
+ gajim.log.error("Out of hosts, giving up connecting to %s", self.name)
self.time_to_reconnect = None
if self.on_connect_failure:
self.on_connect_failure()
diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py
index 20a875fd8..9d7b08af1 100644
--- a/src/common/connection_handlers.py
+++ b/src/common/connection_handlers.py
@@ -38,7 +38,7 @@ from common.commands import ConnectionCommands
from common.pubsub import ConnectionPubSub
STATUS_LIST = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd',
- 'invisible']
+ 'invisible', 'error']
# kind of events we can wait for an answer
VCARD_PUBLISHED = 'vcard_published'
VCARD_ARRIVED = 'vcard_arrived'
diff --git a/src/common/gajim.py b/src/common/gajim.py
index 91e6eab8e..78354108d 100644
--- a/src/common/gajim.py
+++ b/src/common/gajim.py
@@ -121,7 +121,7 @@ sleeper_state = {} # whether we pass auto away / xa or not
status_before_autoaway = {}
SHOW_LIST = ['offline', 'connecting', 'online', 'chat', 'away', 'xa', 'dnd',
- 'invisible']
+ 'invisible', 'error']
# zeroconf account name
ZEROCONF_ACC_NAME = 'Local'
diff --git a/src/gajim.py b/src/gajim.py
index 2209623e9..fcc0d1f76 100755
--- a/src/gajim.py
+++ b/src/gajim.py
@@ -2157,6 +2157,10 @@ if __name__ == '__main__':
# ^C exits the application normally to delete pid file
signal.signal(signal.SIGINT, sigint_cb)
+ if gajim.verbose:
+ print >> sys.stderr, "Encodings: d:%s, fs:%s, p:%s" % \
+ (sys.getdefaultencoding(), sys.getfilesystemencoding(), locale.getpreferredencoding())
+
if os.name != 'nt':
# Session Management support
try: