infrastructure for queueing, redelivery
This commit is contained in:
parent
552c56102e
commit
de6c777d3f
7 changed files with 53 additions and 13 deletions
|
@ -710,7 +710,10 @@ function dfrn_deliver($owner,$contact,$atom) {
|
|||
|
||||
$xml = post_url($contact['notify'],$postvars);
|
||||
|
||||
logger('dfrn_deliver: ' . "SENDING: " . print_r($postvars,true) . "\n" . "RECEIVING: " . $xml);
|
||||
logger('dfrn_deliver: ' . "SENDING: " . print_r($postvars,true) . "\n" . "RECEIVING: " . $xml, LOGGER_DATA);
|
||||
|
||||
if(! strlen($xml))
|
||||
return(-1);
|
||||
|
||||
$res = simplexml_load_string($xml);
|
||||
|
||||
|
|
|
@ -255,10 +255,24 @@
|
|||
case 'dfrn':
|
||||
logger('notifier: dfrndelivery: ' . $contact['name']);
|
||||
$deliver_status = dfrn_deliver($owner,$contact,$atom);
|
||||
|
||||
if($deliver_status == (-1)) {
|
||||
// queue message for redelivery
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
if($followup && $contact['notify']) {
|
||||
slapper($owner,$contact['notify'],$slap);
|
||||
logger('notifier: slapdelivery: ' . $contact['name']);
|
||||
$deliver_status = slapper($owner,$contact['notify'],$slap);
|
||||
|
||||
if($deliver_status == (-1)) {
|
||||
// queue message for redelivery
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
|
@ -269,7 +283,13 @@
|
|||
logger('notifier: slapdelivery: ' . $contact['name']);
|
||||
foreach($slaps as $slappy) {
|
||||
if($contact['notify']) {
|
||||
slapper($owner,$contact['notify'],$slappy);
|
||||
$deliver_status = slapper($owner,$contact['notify'],$slappy);
|
||||
if($deliver_status == (-1)) {
|
||||
// queue message for redelivery
|
||||
// if not already in queue
|
||||
// else if deliver_status ok and queued, remove from queue
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -277,6 +297,7 @@
|
|||
break;
|
||||
}
|
||||
|
||||
|
||||
if(($cmd === 'mail') && ($deliver_status == 0)) {
|
||||
$r = q("UPDATE `mail` SET `delivered` = 1 WHERE `id` = %d LIMIT 1",
|
||||
intval($item_id)
|
||||
|
@ -292,7 +313,7 @@
|
|||
logger('notifier: urldelivery: ' . $url);
|
||||
foreach($slaps as $slappy) {
|
||||
if($url) {
|
||||
slapper($owner,$url,$slappy);
|
||||
$deliver_status = slapper($owner,$url,$slappy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -205,6 +205,8 @@ EOT;
|
|||
|
||||
}
|
||||
logger('slapper returned ' . $return_code);
|
||||
return;
|
||||
if(! $return_code)
|
||||
return(-1);
|
||||
return ((substr($return_code,0,1) === '2') ? 0 : 1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue