From f1e95825c69656239c2ab48fbb0b082f5820b246 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Apitzsch?= <git@apitzsch.eu>
Date: Sun, 4 Feb 2018 17:02:02 +0100
Subject: [PATCH] Migrate config for new password identifier + version bump

---
 gajim/__init__.py         |  2 +-
 gajim/common/optparser.py | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/gajim/__init__.py b/gajim/__init__.py
index d818158b21..870664a75d 100644
--- a/gajim/__init__.py
+++ b/gajim/__init__.py
@@ -1,6 +1,6 @@
 import subprocess
 
-__version__ = "0.98.2"
+__version__ = "0.98.3"
 
 try:
     node = subprocess.Popen('git rev-parse --short=12 HEAD', shell=True,
diff --git a/gajim/common/optparser.py b/gajim/common/optparser.py
index c653247a03..179e30756d 100644
--- a/gajim/common/optparser.py
+++ b/gajim/common/optparser.py
@@ -249,6 +249,8 @@ class OptionsParser:
             self.update_config_to_016112()
         if old < [0, 98, 2] and new >= [0, 98, 2]:
             self.update_config_to_0982()
+        if old < [0, 98, 3] and new >= [0, 98, 3]:
+            self.update_config_to_0983()
 
         app.logger.init_vars()
         app.logger.attach_cache_database()
@@ -924,3 +926,12 @@ class OptionsParser:
             '''
         )
         app.config.set('version', '0.98.2')
+
+    def update_config_to_0983(self):
+        for account in self.old_values['accounts'].keys():
+            password = self.old_values['accounts'][account]['password']
+            if password == "winvault:":
+                app.config.set_per('accounts', account, 'password', 'keyring:')
+            elif password == "libsecret:":
+                app.config.set_per('accounts', account, 'password', '')
+        app.config.set('version', '0.98.3')
-- 
GitLab