Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim-plugins.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Leboulanger <yann@leboulanger.org>2017-08-03 15:12:47 +0300
committerYann Leboulanger <yann@leboulanger.org>2017-08-03 15:12:47 +0300
commit1e04f92abba6d86cd2a81842f6e2885bc33b4861 (patch)
tree15f75d444f4e7115dd6b0d56b67169c27fc3b0f7
parent346da609340845280aacb4d31540f35963d763e1 (diff)
[plugin_installer] do not update plugin if it's not compatible with
current Gajim version. Fixes #225
-rw-r--r--plugin_installer/plugin_installer.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugin_installer/plugin_installer.py b/plugin_installer/plugin_installer.py
index 5f7b54e..8bc210f 100644
--- a/plugin_installer/plugin_installer.py
+++ b/plugin_installer/plugin_installer.py
@@ -450,7 +450,13 @@ class DownloadAsync(threading.Thread):
for plugin in plugin_list:
local_version = get_local_version(plugin['name'])
if local_version:
- if V(plugin['version']) > V(local_version):
+ gajim_v = V(gajim.config.get('version'))
+ min_v = plugin.get('min_gajim_version', None)
+ min_v = V(min_v) if min_v else gajim_v
+ max_v = plugin.get('max_gajim_version', None)
+ max_v = V(max_v) if max_v else gajim_v
+ if (V(plugin['version']) > V(local_version)) and \
+ gajim_v >= min_v and gajim_v <= max_v:
to_update.append(plugin['name'])
GLib.idle_add(self.plugin.warn_update, to_update)