a few clone sync fixes as well as some work on hubzilla clone sync back to redmatrix
This commit is contained in:
parent
9369e521bb
commit
065a50c920
@ -818,11 +818,25 @@ function diaspora_request($importer,$xml) {
|
|||||||
'link' => z_root() . '/connedit/' . $new_connection[0]['abook_id'],
|
'link' => z_root() . '/connedit/' . $new_connection[0]['abook_id'],
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
if($default_perms) {
|
if($default_perms) {
|
||||||
// Send back a sharing notification to them
|
// Send back a sharing notification to them
|
||||||
diaspora_share($importer,$new_connection[0]);
|
diaspora_share($importer,$new_connection[0]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$clone = array();
|
||||||
|
foreach($new_connection[0] as $k => $v) {
|
||||||
|
if(strpos($k,'abook_') === 0) {
|
||||||
|
$clone[$k] = $v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
unset($clone['abook_id']);
|
||||||
|
unset($clone['abook_account']);
|
||||||
|
unset($clone['abook_channel']);
|
||||||
|
|
||||||
|
build_sync_packet($importer['channel_id'], array('abook' => array($clone)));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2922,6 +2922,28 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
|
|||||||
|
|
||||||
foreach($arr['abook'] as $abook) {
|
foreach($arr['abook'] as $abook) {
|
||||||
|
|
||||||
|
if(array_key_exists('abook_blocked',$abook)) {
|
||||||
|
// convert from hubzilla
|
||||||
|
$abook['abook_flags'] = 0;
|
||||||
|
if(intval($abook['abook_blocked']))
|
||||||
|
$abook['abook_flags'] |= ABOOK_FLAG_BLOCKED;
|
||||||
|
if(intval($abook['abook_ignored']))
|
||||||
|
$abook['abook_flags'] |= ABOOK_FLAG_IGNORED;
|
||||||
|
if(intval($abook['abook_hidden']))
|
||||||
|
$abook['abook_flags'] |= ABOOK_FLAG_HIDDEN;
|
||||||
|
if(intval($abook['abook_archived']))
|
||||||
|
$abook['abook_flags'] |= ABOOK_FLAG_ARCHIVED;
|
||||||
|
if(intval($abook['abook_pending']))
|
||||||
|
$abook['abook_flags'] |= ABOOK_FLAG_PENDING;
|
||||||
|
if(intval($abook['abook_unconnected']))
|
||||||
|
$abook['abook_flags'] |= ABOOK_FLAG_UNCONNECTED;
|
||||||
|
if(intval($abook['abook_self']))
|
||||||
|
$abook['abook_flags'] |= ABOOK_FLAG_SELF;
|
||||||
|
if(intval($abook['abook_feed']))
|
||||||
|
$abook['abook_flags'] |= ABOOK_FLAG_FEED;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$clean = array();
|
$clean = array();
|
||||||
if($abook['abook_xchan'] && $abook['entry_deleted']) {
|
if($abook['abook_xchan'] && $abook['entry_deleted']) {
|
||||||
logger('process_channel_sync_delivery: removing abook entry for ' . $abook['abook_xchan']);
|
logger('process_channel_sync_delivery: removing abook entry for ' . $abook['abook_xchan']);
|
||||||
|
@ -24,6 +24,19 @@ function follow_init(&$a) {
|
|||||||
|
|
||||||
info( t('Channel added.') . EOL);
|
info( t('Channel added.') . EOL);
|
||||||
|
|
||||||
|
$clone = array();
|
||||||
|
foreach($result['abook'] as $k => $v) {
|
||||||
|
if(strpos($k,'abook_') === 0) {
|
||||||
|
$clone[$k] = $v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
unset($clone['abook_id']);
|
||||||
|
unset($clone['abook_account']);
|
||||||
|
unset($clone['abook_channel']);
|
||||||
|
|
||||||
|
build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone)));
|
||||||
|
|
||||||
|
|
||||||
// If we can view their stream, pull in some posts
|
// If we can view their stream, pull in some posts
|
||||||
|
|
||||||
if(($result['abook']['abook_their_perms'] & PERMS_R_STREAM) || ($result['abook']['xchan_network'] === 'rss'))
|
if(($result['abook']['abook_their_perms'] & PERMS_R_STREAM) || ($result['abook']['xchan_network'] === 'rss'))
|
||||||
|
@ -33,6 +33,7 @@ function pconfig_post(&$a) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_pconfig(local_channel(),$cat,$k,$v);
|
set_pconfig(local_channel(),$cat,$k,$v);
|
||||||
|
build_sync_packet();
|
||||||
|
|
||||||
goaway(z_root() . '/pconfig/' . $cat . '/' . $k);
|
goaway(z_root() . '/pconfig/' . $cat . '/' . $k);
|
||||||
|
|
||||||
|
@ -4,11 +4,13 @@
|
|||||||
// Red pconfig utility
|
// Red pconfig utility
|
||||||
|
|
||||||
require_once('include/cli_startup.php');
|
require_once('include/cli_startup.php');
|
||||||
|
require_once('include/zot.php');
|
||||||
|
|
||||||
cli_startup();
|
cli_startup();
|
||||||
|
|
||||||
if($argc > 4) {
|
if($argc > 4) {
|
||||||
set_pconfig($argv[1],$argv[2],$argv[3],$argv[4]);
|
set_pconfig($argv[1],$argv[2],$argv[3],$argv[4]);
|
||||||
|
build_sync_packet($argv[1]);
|
||||||
echo "pconfig[{$argv[1]}][{$argv[2]}][{$argv[3]}] = " . get_pconfig($argv[1],$argv[2],$argv[3]) . "\n";
|
echo "pconfig[{$argv[1]}][{$argv[2]}][{$argv[3]}] = " . get_pconfig($argv[1],$argv[2],$argv[3]) . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user