local delivery
This commit is contained in:
parent
c38ec1ab48
commit
7b4a92146f
@ -20,16 +20,27 @@ function deliver_run($argv, $argc) {
|
|||||||
dbesc($argv[$x])
|
dbesc($argv[$x])
|
||||||
);
|
);
|
||||||
if($r) {
|
if($r) {
|
||||||
$result = zot_zot($r[0]['outq_posturl'],$r[0]['outq_notify']);
|
if($r[0]['outq_posturl'] === z_root() . '/post') {
|
||||||
if($result['success']) {
|
// local delivery
|
||||||
zot_process_response($result, $r[0]);
|
// we should probably batch these and save a few delivery processes
|
||||||
}
|
$msg = array('body' => json_encode(array('pickup' => array(array('notify' => json_decode($r[0]['outq_notify'],true),'message' => json_decode($r[0]['outq_msg'],true))))));
|
||||||
else {
|
zot_import($msg);
|
||||||
$y = q("update outq set outq_updated = '%s' where outq_hash = '%s' limit 1",
|
$r = q("delete from outq where outq_hash = '%s' limit 1",
|
||||||
dbesc(datetime_convert()),
|
|
||||||
dbesc($argv[$x])
|
dbesc($argv[$x])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$result = zot_zot($r[0]['outq_posturl'],$r[0]['outq_notify']);
|
||||||
|
if($result['success']) {
|
||||||
|
zot_process_response($result, $r[0]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$y = q("update outq set outq_updated = '%s' where outq_hash = '%s' limit 1",
|
||||||
|
dbesc(datetime_convert()),
|
||||||
|
dbesc($argv[$x])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -703,15 +703,16 @@ function zot_import($arr) {
|
|||||||
|
|
||||||
logger('Activity received: ' . print_r($arr,true));
|
logger('Activity received: ' . print_r($arr,true));
|
||||||
logger('Activity recipients: ' . print_r($deliveries,true));
|
logger('Activity recipients: ' . print_r($deliveries,true));
|
||||||
dbg(1);
|
|
||||||
$relay = ((array_key_exists('flags',$i['message']) && in_array('relay',$i['message']['flags'])) ? true : false);
|
$relay = ((array_key_exists('flags',$i['message']) && in_array('relay',$i['message']['flags'])) ? true : false);
|
||||||
process_delivery($i['notify']['sender'],$arr,$deliveries,$relay);
|
process_delivery($i['notify']['sender'],$arr,$deliveries,$relay);
|
||||||
dbg(0);
|
|
||||||
}
|
}
|
||||||
elseif($i['message']['type'] === 'mail') {
|
elseif($i['message']['type'] === 'mail') {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user