more z6 debugging
This commit is contained in:
parent
c80ac58eff
commit
da452decf6
@ -645,6 +645,7 @@ class Notifier {
|
|||||||
'account_id' => $channel['channel_account_id'],
|
'account_id' => $channel['channel_account_id'],
|
||||||
'channel_id' => $channel['channel_id'],
|
'channel_id' => $channel['channel_id'],
|
||||||
'posturl' => $hub['hubloc_callback'],
|
'posturl' => $hub['hubloc_callback'],
|
||||||
|
'driver' => $hub['hubloc_network'],
|
||||||
'notify' => $packet,
|
'notify' => $packet,
|
||||||
'msg' => (($pmsg) ? json_encode($pmsg) : '')
|
'msg' => (($pmsg) ? json_encode($pmsg) : '')
|
||||||
));
|
));
|
||||||
|
@ -333,8 +333,8 @@ class Libzot {
|
|||||||
if($permissions && is_array($permissions)) {
|
if($permissions && is_array($permissions)) {
|
||||||
$old_read_stream_perm = get_abconfig($channel['channel_id'],$x['hash'],'their_perms','view_stream');
|
$old_read_stream_perm = get_abconfig($channel['channel_id'],$x['hash'],'their_perms','view_stream');
|
||||||
|
|
||||||
foreach($permissions as $k => $v) {
|
foreach($permissions as $p) {
|
||||||
set_abconfig($channel['channel_id'],$x['hash'],'their_perms',$k,$v);
|
set_abconfig($channel['channel_id'],$x['hash'],'their_perms',$p,'1');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -974,6 +974,7 @@ logger('4');
|
|||||||
}
|
}
|
||||||
|
|
||||||
$x = crypto_unencapsulate($x, get_config('system','prvkey'));
|
$x = crypto_unencapsulate($x, get_config('system','prvkey'));
|
||||||
|
|
||||||
if(! is_array($x)) {
|
if(! is_array($x)) {
|
||||||
$x = json_decode($x,true);
|
$x = json_decode($x,true);
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ namespace Zotlabs\Module;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use Zotlabs\Lib\Apps;
|
use Zotlabs\Lib\Apps;
|
||||||
|
use Zotlabs\Lib\Libzot;
|
||||||
|
|
||||||
require_once('include/socgraph.php');
|
require_once('include/socgraph.php');
|
||||||
require_once('include/selectors.php');
|
require_once('include/selectors.php');
|
||||||
@ -475,6 +476,10 @@ class Connedit extends \Zotlabs\Web\Controller {
|
|||||||
if(! zot_refresh($orig_record[0],\App::get_channel()))
|
if(! zot_refresh($orig_record[0],\App::get_channel()))
|
||||||
notice( t('Refresh failed - channel is currently unavailable.') );
|
notice( t('Refresh failed - channel is currently unavailable.') );
|
||||||
}
|
}
|
||||||
|
elseif($orig_record[0]['xchan_network'] === 'zot6') {
|
||||||
|
if(! Libzot::refresh($orig_record[0],\App::get_channel()))
|
||||||
|
notice( t('Refresh failed - channel is currently unavailable.') );
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
// if you are on a different network we'll force a refresh of the connection basic info
|
// if you are on a different network we'll force a refresh of the connection basic info
|
||||||
|
@ -225,9 +225,14 @@ function crypto_unencapsulate($data,$prvkey) {
|
|||||||
if(! $data)
|
if(! $data)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$alg = ((array_key_exists('alg',$data)) ? $data['alg'] : 'aes256cbc');
|
$alg = ((is_array($data) && array_key_exists('encrypted',$data)) ? $data['alg'] : '');
|
||||||
if($alg === 'aes256cbc')
|
if(! $alg) {
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($alg === 'aes256cbc') {
|
||||||
return aes_unencapsulate($data,$prvkey);
|
return aes_unencapsulate($data,$prvkey);
|
||||||
|
}
|
||||||
|
|
||||||
return other_unencapsulate($data,$prvkey,$alg);
|
return other_unencapsulate($data,$prvkey,$alg);
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ function queue_deliver($outq, $immediate = false) {
|
|||||||
$zot = new Receiver(new Zot6Handler(),$outq['outq_notify']);
|
$zot = new Receiver(new Zot6Handler(),$outq['outq_notify']);
|
||||||
$result = $zot->run(true);
|
$result = $zot->run(true);
|
||||||
logger('returned_json: ' . json_encode($result,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES), LOGGER_DATA);
|
logger('returned_json: ' . json_encode($result,JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES), LOGGER_DATA);
|
||||||
logger('deliver: local zot delivery succeeded to ' . $outq['outq_posturl']);
|
logger('deliver: local zot6 delivery succeeded to ' . $outq['outq_posturl']);
|
||||||
Libzot::process_response($outq['outq_posturl'],[ 'success' => true, 'body' => json_encode($result) ], $outq);
|
Libzot::process_response($outq['outq_posturl'],[ 'success' => true, 'body' => json_encode($result) ], $outq);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -250,8 +250,7 @@ function queue_deliver($outq, $immediate = false) {
|
|||||||
|
|
||||||
$host_crypto = null;
|
$host_crypto = null;
|
||||||
if($channel && $base) {
|
if($channel && $base) {
|
||||||
$h = q("select hubloc_sitekey, site_crypto from hubloc left join site on hubloc_url = site_url where site_url = '%s' and\
|
$h = q("select hubloc_sitekey, site_crypto from hubloc left join site on hubloc_url = site_url where site_url = '%s' and hubloc_network = 'zot6' order by hubloc_id desc limit 1",
|
||||||
hubloc_network = 'zot6' order by hubloc_id desc limit 1",
|
|
||||||
dbesc($base)
|
dbesc($base)
|
||||||
);
|
);
|
||||||
if($h) {
|
if($h) {
|
||||||
@ -264,12 +263,12 @@ function queue_deliver($outq, $immediate = false) {
|
|||||||
$result = Libzot::zot($outq['outq_posturl'],$msg,$channel,$host_crypto);
|
$result = Libzot::zot($outq['outq_posturl'],$msg,$channel,$host_crypto);
|
||||||
|
|
||||||
if($result['success']) {
|
if($result['success']) {
|
||||||
logger('deliver: remote zot delivery succeeded to ' . $outq['outq_posturl']);
|
logger('deliver: remote zot6 delivery succeeded to ' . $outq['outq_posturl']);
|
||||||
Libzot::process_response($outq['outq_posturl'],$result, $outq);
|
Libzot::process_response($outq['outq_posturl'],$result, $outq);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logger('deliver: remote zot delivery failed to ' . $outq['outq_posturl']);
|
logger('deliver: remote zot6 delivery failed to ' . $outq['outq_posturl']);
|
||||||
logger('deliver: remote zot delivery fail data: ' . print_r($result,true), LOGGER_DATA);
|
logger('deliver: remote zot6 delivery fail data: ' . print_r($result,true), LOGGER_DATA);
|
||||||
update_queue_item($outq['outq_hash'],10);
|
update_queue_item($outq['outq_hash'],10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user