From 4eaddd12796cd49e9ee5d5527e2eaa519279d57e Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 24 Mar 2020 08:32:37 +0000 Subject: do not sync with incompatible hubs --- include/zot.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'include/zot.php') diff --git a/include/zot.php b/include/zot.php index 7d7df9ece..bb5537d2e 100644 --- a/include/zot.php +++ b/include/zot.php @@ -3299,7 +3299,7 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) { if(intval($channel['channel_removed'])) return; - $h = q("select hubloc.*, site.site_crypto from hubloc left join site on site_url = hubloc_url where hubloc_hash = '%s' and hubloc_deleted = 0", + $h = q("select hubloc.*, site.site_crypto, site.site_version, site.site_project from hubloc left join site on site_url = hubloc_url where hubloc_hash = '%s' and hubloc_deleted = 0", dbesc(($keychange) ? $packet['keychange']['old_hash'] : $channel['channel_portable_id']) ); @@ -3312,6 +3312,14 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) { if($x['hubloc_host'] == App::get_hostname()) continue; + if(stripos($x['site_project'], 'hubzilla') !== false && version_compare($x['site_version'], '4.7.3', '<=')) { + + logger('Dismiss sync due to incompatible version.'); + // logger(print_r($x,true)); + continue; + + } + $y = q("select site_dead from site where site_url = '%s' limit 1", dbesc($x['hubloc_url']) ); @@ -3326,6 +3334,7 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) { $r = q("select xchan_guid, xchan_guid_sig from xchan where xchan_hash = '%s' limit 1", dbesc($channel['channel_portable_id']) ); + if(! $r) return; -- cgit v1.2.3