Merge pull request #4 from redmatrix/master
updating from original codebase
This commit is contained in:
commit
006ca4421a
@ -836,6 +836,7 @@ function title_is_body($title, $body) {
|
||||
function get_item_elements($x,$allow_code = false) {
|
||||
|
||||
$arr = array();
|
||||
|
||||
if($allow_code)
|
||||
$arr['body'] = $x['body'];
|
||||
else
|
||||
|
@ -957,7 +957,7 @@ function zot_process_response($hub, $arr, $outq) {
|
||||
logger('zot_process_response: headers: ' . print_r($arr['header'],true), LOGGER_DATA);
|
||||
}
|
||||
|
||||
if(array_key_exists('delivery_report',$x)) {
|
||||
if(is_array($x) && array_key_exists('delivery_report',$x) && is_array($x['delivery_report'])) {
|
||||
foreach($x['delivery_report'] as $xx) {
|
||||
if(is_array($xx) && array_key_exists('message_id',$xx)) {
|
||||
q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s','%s','%s','%s','%s' ) ",
|
||||
@ -1583,11 +1583,12 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $
|
||||
$DR->addto_recipient($channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>');
|
||||
|
||||
|
||||
if($d['hash'] === $sender['hash']) {
|
||||
$DR->update('self delivery ignored');
|
||||
$result[] = $DR->get();
|
||||
continue;
|
||||
}
|
||||
// uncomment this once we find out what's stopping the clone sync of the item from working
|
||||
// if($d['hash'] === $sender['hash']) {
|
||||
// $DR->update('self delivery ignored');
|
||||
// $result[] = $DR->get();
|
||||
// continue;
|
||||
// }
|
||||
|
||||
|
||||
// allow public postings to the sys channel regardless of permissions, but not
|
||||
@ -2815,7 +2816,7 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) {
|
||||
|
||||
$channel = $r[0];
|
||||
|
||||
$h = q("select * from hubloc where hubloc_hash = '%s'",
|
||||
$h = q("select * from hubloc where hubloc_hash = '%s' and hubloc_deleted = 0",
|
||||
dbesc($channel['channel_hash'])
|
||||
);
|
||||
|
||||
@ -3311,7 +3312,27 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
|
||||
}
|
||||
}
|
||||
|
||||
$result[] = array($d['hash'],'channel sync updated',$channel['channel_name'],'');
|
||||
|
||||
if(array_key_exists('item',$arr) && $arr['item'])
|
||||
sync_items($channel,$arr['item']);
|
||||
|
||||
if(array_key_exists('item_id',$arr) && $arr['item_id'])
|
||||
sync_items($channel,$arr['item_id']);
|
||||
|
||||
|
||||
// we should probably do this for all items, but usually we only send one.
|
||||
|
||||
require_once('include/DReport.php');
|
||||
|
||||
if(array_key_exists('item',$arr) && is_array($arr['item'][0])) {
|
||||
$DR = new DReport(z_root(),$d['hash'],$d['hash'],$arr['item'][0]['message_id'],'channel sync processed');
|
||||
$DR->addto_recipient($channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>');
|
||||
}
|
||||
else
|
||||
$DR = new DReport(z_root(),$d['hash'],$d['hash'],'sync packet','channel sync delivered');
|
||||
|
||||
$result[] = $DR->get();
|
||||
|
||||
}
|
||||
|
||||
return $result;
|
||||
@ -3753,4 +3774,5 @@ function zotinfo($arr) {
|
||||
}
|
||||
call_hooks('zot_finger',$ret);
|
||||
return($ret);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user