aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgit-marijus <mario@mariovavti.com>2017-05-04 09:59:35 +0200
committerGitHub <noreply@github.com>2017-05-04 09:59:35 +0200
commitbc776a9534b57231b83f4c65fefdc3637db0e024 (patch)
tree95715134462579699fe8cc13d1925ebfc0d032e2
parent45c64c2d2e5f7bde8a12c0010cd87eea106a65c6 (diff)
parent1e59d9ade576acbd1768303cb9e9c994b4d50392 (diff)
downloadvolse-hubzilla-bc776a9534b57231b83f4c65fefdc3637db0e024.tar.gz
volse-hubzilla-bc776a9534b57231b83f4c65fefdc3637db0e024.tar.bz2
volse-hubzilla-bc776a9534b57231b83f4c65fefdc3637db0e024.zip
Merge pull request #750 from zotlabs/abnothere
abook_not_here flag created to indicate singleton connections which a…
-rw-r--r--Zotlabs/Module/Import.php3
-rwxr-xr-xboot.php2
-rw-r--r--include/connections.php1
-rw-r--r--include/zot.php4
-rw-r--r--install/schema_mysql.sql2
-rw-r--r--install/schema_postgres.sql2
-rw-r--r--install/update.php11
7 files changed, 19 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 12510bbd3..60a453c77 100755
--- a/boot.php
+++ b/boot.php
@@ -52,7 +52,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'STD_VERSION', '2.3.5' );
define ( 'ZOT_REVISION', '1.2' );
-define ( 'DB_UPDATE_VERSION', 1190 );
+define ( 'DB_UPDATE_VERSION', 1191 );
define ( 'PROJECT_BASE', __DIR__ );
diff --git a/include/connections.php b/include/connections.php
index a8d7d8483..8f4f84e1a 100644
--- a/include/connections.php
+++ b/include/connections.php
@@ -23,6 +23,7 @@ function abook_store_lowlevel($arr) {
'abook_unconnected' => ((array_key_exists('abook_unconnected',$arr)) ? $arr['abook_unconnected'] : 0),
'abook_self' => ((array_key_exists('abook_self',$arr)) ? $arr['abook_self'] : 0),
'abook_feed' => ((array_key_exists('abook_feed',$arr)) ? $arr['abook_feed'] : 0),
+ 'abook_not_here' => ((array_key_exists('abook_not_here',$arr)) ? $arr['abook_not_here'] : 0),
'abook_profile' => ((array_key_exists('abook_profile',$arr)) ? $arr['abook_profile'] : ''),
'abook_incl' => ((array_key_exists('abook_incl',$arr)) ? $arr['abook_incl'] : ''),
'abook_excl' => ((array_key_exists('abook_excl',$arr)) ? $arr['abook_excl'] : ''),
diff --git a/include/zot.php b/include/zot.php
index 20a25ce3b..a168dff1b 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 0328040f4..774f355aa 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 @@
<?php
-define( 'UPDATE_VERSION' , 1190 );
+define( 'UPDATE_VERSION' , 1191 );
/**
*
@@ -2532,3 +2532,12 @@ function update_r1189() {
}
+function update_r1190() {
+ $r1 = q("alter table abook add abook_not_here int(11) not null default '0' ");
+
+ $r2 = q("create index abook_not_here on abook (abook_not_here)");
+
+ if($r1 && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}