From 3919c8f79f9f104e99b161e9034c68eba3fe86a0 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 3 May 2017 18:50:32 -0700 Subject: abook_not_here flag created to indicate singleton connections which are connected to this channel but not on this hub. abook_instance enumerates which hubs the connections is valid, but we ultimately need something more efficiently searchable to decide what operations are supported w/r/t this connection in the context of this hub. This flag is ignored during sync to clones although the code to set it correctly during channel creation, import, and sync has not yet been implemented. --- Zotlabs/Module/Import.php | 3 ++- boot.php | 2 +- include/zot.php | 4 +--- install/schema_mysql.sql | 2 ++ install/schema_postgres.sql | 2 ++ install/update.php | 11 ++++++++++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Zotlabs/Module/Import.php b/Zotlabs/Module/Import.php index 54bc7de81..ce3fd469a 100644 --- a/Zotlabs/Module/Import.php +++ b/Zotlabs/Module/Import.php @@ -318,6 +318,7 @@ class Import extends \Zotlabs\Web\Controller { unset($abook['abconfig']); unset($abook['abook_their_perms']); unset($abook['abook_my_perms']); + unset($abook['abook_not_here']); $abook['abook_account'] = $account_id; $abook['abook_channel'] = $channel['channel_id']; @@ -347,7 +348,7 @@ class Import extends \Zotlabs\Web\Controller { continue; } - create_table_from_array('abook',$abook); + abook_store_lowlevel($abook); $friends ++; if(intval($abook['abook_feed'])) diff --git a/boot.php b/boot.php index b196f64dd..7e75e3aac 100755 --- a/boot.php +++ b/boot.php @@ -53,7 +53,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'STD_VERSION', '2.4RC' ); define ( 'ZOT_REVISION', '1.2' ); -define ( 'DB_UPDATE_VERSION', 1190 ); +define ( 'DB_UPDATE_VERSION', 1191 ); define ( 'PROJECT_BASE', __DIR__ ); diff --git a/include/zot.php b/include/zot.php index 14c6662e3..748fe7b99 100644 --- a/include/zot.php +++ b/include/zot.php @@ -3226,12 +3226,10 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { } - $disallowed = array('abook_id','abook_account','abook_channel','abook_rating','abook_rating_text'); + $disallowed = array('abook_id','abook_account','abook_channel','abook_rating','abook_rating_text','abook_not_here'); foreach($arr['abook'] as $abook) { - - $abconfig = null; if(array_key_exists('abconfig',$abook) && is_array($abook['abconfig']) && count($abook['abconfig'])) diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index b64c1ae61..602f7ac2f 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -34,6 +34,7 @@ CREATE TABLE IF NOT EXISTS `abook` ( `abook_unconnected` tinyint(4) NOT NULL DEFAULT '0', `abook_self` tinyint(4) NOT NULL DEFAULT '0', `abook_feed` tinyint(4) NOT NULL DEFAULT '0', + `abook_not_here` tinyint(4) NOT NULL DEFAULT '0', `abook_profile` char(64) NOT NULL DEFAULT '', `abook_incl` TEXT NOT NULL DEFAULT '', `abook_excl` TEXT NOT NULL DEFAULT '', @@ -58,6 +59,7 @@ CREATE TABLE IF NOT EXISTS `abook` ( KEY `abook_pending` (`abook_pending`), KEY `abook_unconnected` (`abook_unconnected`), KEY `abook_self` (`abook_self`), + KEY `abook_not_here` (`abook_not_here`), KEY `abook_feed` (`abook_feed`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 4c65d165d..389cc6a84 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -32,6 +32,7 @@ CREATE TABLE "abook" ( "abook_unconnected" smallint NOT NULL DEFAULT '0', "abook_self" smallint NOT NULL DEFAULT '0', "abook_feed" smallint NOT NULL DEFAULT '0', + "abook_not_here" smallint NOT NULL DEFAULT '0', "abook_profile" char(64) NOT NULL DEFAULT '', "abook_incl" TEXT NOT NULL DEFAULT '', "abook_excl" TEXT NOT NULL DEFAULT '', @@ -55,6 +56,7 @@ CREATE TABLE "abook" ( create index "abook_unconnected" on abook ("abook_unconnected"); create index "abook_self" on abook ("abook_self"); create index "abook_feed" on abook ("abook_feed"); + create index "abook_not_here" on abook ("abook_not_here"); create index "abook_profile" on abook ("abook_profile"); create index "abook_dob" on abook ("abook_dob"); create index "abook_connected" on abook ("abook_connected"); diff --git a/install/update.php b/install/update.php index ce65d1db9..65506a2f7 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@