aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-05-25 13:37:13 -0700
committerzotlabs <mike@macgirvin.com>2017-05-25 13:37:13 -0700
commitb4da2d35bf8084da812be0716917a0f88cf68f91 (patch)
tree32cf6c3b86773c152ab22c534a07ae2d84285008
parentfd357f87be5bbdbe135173305cdc9ba550a34e21 (diff)
downloadvolse-hubzilla-b4da2d35bf8084da812be0716917a0f88cf68f91.tar.gz
volse-hubzilla-b4da2d35bf8084da812be0716917a0f88cf68f91.tar.bz2
volse-hubzilla-b4da2d35bf8084da812be0716917a0f88cf68f91.zip
start using the abook_not_here flag (requires changes in addons, not easily portable to hubzilla)
-rw-r--r--Zotlabs/Module/Import.php4
-rw-r--r--include/follow.php10
-rw-r--r--include/zot.php5
3 files changed, 14 insertions, 5 deletions
diff --git a/Zotlabs/Module/Import.php b/Zotlabs/Module/Import.php
index ce3fd469a..a2f83e1cb 100644
--- a/Zotlabs/Module/Import.php
+++ b/Zotlabs/Module/Import.php
@@ -333,6 +333,10 @@ class Import extends \Zotlabs\Web\Controller {
$abook['abook_feed'] = (($abook['abook_flags'] & 0x0100 ) ? 1 : 0);
}
+ if(array_key_exists('abook_instance',$abook) && $abook['abook_instance'] && strpos($abook['abook_instance'],z_root()) === false) {
+ $abook['abook_not_here'] = 1;
+ }
+
if($abook['abook_self']) {
$role = get_pconfig($channel['channel_id'],'system','permissions_role');
if(($role === 'forum') || ($abook['abook_my_perms'] & PERMS_W_TAGWALL)) {
diff --git a/include/follow.php b/include/follow.php
index 0d7c16aa3..2c2f5e209 100644
--- a/include/follow.php
+++ b/include/follow.php
@@ -226,12 +226,12 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
if($abook_instance)
$abook_instance .= ',';
$abook_instance .= z_root();
- }
- $x = q("update abook set abook_instance = '%s' where abook_id = %d",
- dbesc($abook_instance),
- intval($r[0]['abook_id'])
- );
+ $x = q("update abook set abook_instance = '%s', abook_not_here = 0 where abook_id = %d",
+ dbesc($abook_instance),
+ intval($r[0]['abook_id'])
+ );
+ }
if(intval($r[0]['abook_pending'])) {
$x = q("update abook set abook_pending = 0 where abook_id = %d",
diff --git a/include/zot.php b/include/zot.php
index 748fe7b99..d2088f272 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -3289,6 +3289,11 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
if(! array_key_exists('abook_xchan',$clean))
continue;
+ if(array_key_exists('abook_instance',$clean) && $clean['abook_instance'] && strpos($clean['abook_instance'],z_root()) === false) {
+ $clean['abook_not_here'] = 1;
+ }
+
+
$r = q("select * from abook where abook_xchan = '%s' and abook_channel = %d limit 1",
dbesc($clean['abook_xchan']),
intval($channel['channel_id'])