From 4ce9d8907718fe911bc967f1d41d6d3b5d8a3e32 Mon Sep 17 00:00:00 2001 From: Tomasz Melcer Date: Fri, 13 Jul 2007 14:44:01 +0000 Subject: [PATCH] caps: Real fix for [3295] -- changing separator from ' ' to '\0'. --- configure.ac | 2 +- src/common/defs.py | 2 +- src/common/logger.py | 4 ++-- src/common/optparser.py | 21 +++++++++++++++++++++ 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index aa4674623..c4bdb142e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_INIT([Gajim - A Jabber Instant Messager], - [0.11.1.4],[http://trac.gajim.org/],[gajim]) + [0.11.1.5],[http://trac.gajim.org/],[gajim]) AC_PREREQ([2.59]) AM_INIT_AUTOMAKE([1.8]) AC_CONFIG_HEADER(config.h) diff --git a/src/common/defs.py b/src/common/defs.py index 35bf91f8a..d557e6912 100644 --- a/src/common/defs.py +++ b/src/common/defs.py @@ -2,7 +2,7 @@ docdir = '../' datadir = '../' -version = '0.11.1.4' +version = '0.11.1.5' import sys, os.path for base in ('.', 'common'): diff --git a/src/common/logger.py b/src/common/logger.py index ee6aa5cc9..e5a36a8fe 100644 --- a/src/common/logger.py +++ b/src/common/logger.py @@ -664,7 +664,7 @@ class Logger: # (format: (category, type, name, category, type, name, ... # ..., 'FEAT', feature1, feature2, ...).join(' ')) # NOTE: if there's a need to do more gzip, put that to a function - data=GzipFile(fileobj=StringIO(str(data))).read().split(' ') # (2) -- note above + data=GzipFile(fileobj=StringIO(str(data))).read().split('\0') # (2) -- note above i=0 identities=set() features=set() @@ -694,7 +694,7 @@ class Logger: data.extend(identity) data.append('FEAT') data.extend(features) - data = ' '.join(data) + data = '\0'.join(data) string = StringIO() # if there's a need to do more gzip, put that to a function gzip=GzipFile(fileobj=string, mode='w') gzip.write(data) diff --git a/src/common/optparser.py b/src/common/optparser.py index 807c69740..c5aaede3e 100644 --- a/src/common/optparser.py +++ b/src/common/optparser.py @@ -161,6 +161,8 @@ class OptionsParser: self.update_config_to_01113() if old < [0, 11, 1, 4] and new >= [0, 11, 1, 4]: self.update_config_to_01114() + if old < [0, 11, 1, 5] and new >= [0, 11, 1, 5]: + self.update_config_to_01115() gajim.logger.init_vars() gajim.config.set('version', new_version) @@ -455,3 +457,22 @@ class OptionsParser: for o in d: gajim.config.set_per('themes', theme_name, o, theme[d.index(o)]) gajim.config.set('version', '0.11.1.4') + + def update_config_to_01115(self): + # copy&pasted from update_config_to_01013, possibly 'FIXME see #2812' applies too + back = os.getcwd() + os.chdir(logger.LOG_DB_FOLDER) + con = sqlite.connect(logger.LOG_DB_FILE) + os.chdir(back) + cur = con.cursor() + try: + cur.executescript( + ''' + DELETE FROM caps_cache; + ''' + ) + con.commit() + except sqlite.OperationalError, e: + pass + con.close() + gajim.config.set('version', '0.11.1.5')