diff options
author | friendica <info@friendica.com> | 2013-07-21 17:19:16 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2013-07-21 17:19:16 -0700 |
commit | 9f1fa5aba27d7f169569734190cfb9279160207c (patch) | |
tree | ade2c9d36a21910fb0be8ad040299addac49b6e0 /include/notifier.php | |
parent | 2f0c853ba0f619d26a63290cb55926fce99c6ed4 (diff) | |
download | volse-hubzilla-9f1fa5aba27d7f169569734190cfb9279160207c.tar.gz volse-hubzilla-9f1fa5aba27d7f169569734190cfb9279160207c.tar.bz2 volse-hubzilla-9f1fa5aba27d7f169569734190cfb9279160207c.zip |
improvements in delivery logging
Diffstat (limited to 'include/notifier.php')
-rw-r--r-- | include/notifier.php | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/include/notifier.php b/include/notifier.php index 96c0bf31f..9a8866223 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -334,18 +334,26 @@ function notifier_run($argv, $argc){ if(! $recipients) return; - logger('notifier: recipients: ' . print_r($recipients,true)); +// logger('notifier: recipients: ' . print_r($recipients,true)); - $env_recips = null; - if($private) { - $r = q("select xchan_guid, xchan_guid_sig from xchan where xchan_hash in (" . implode(',',$recipients) . ")"); - if($r) { - $env_recips = array(); - foreach($r as $rr) - $env_recips[] = array('guid' => $rr['xchan_guid'],'guid_sig' => $rr['xchan_guid_sig']); + $env_recips = (($private) ? array() : null); + + $details = q("select xchan_hash, xchan_addr, xchan_guid, xchan_guid_sig from xchan where xchan_hash in (" . implode(',',$recipients) . ")"); + + $recip_list = array(); + + if($details) { + foreach($details as $d) { + $recip_list[] = $d['xchan_addr'] . ' (' . $d['xchan_hash'] . ')'; + if($private) + $env_recips[] = array('guid' => $d['xchan_guid'],'guid_sig' => $d['xchan_guid_sig']); } } + + logger('notifier: recipients (may be delivered to more if public): ' . print_r($recip_list,true), LOGGER_DEBUG); + + // Now we have collected recipients (except for external mentions, FIXME) // Let's reduce this to a set of hubs. @@ -362,6 +370,11 @@ function notifier_run($argv, $argc){ } $hubs = $r; + $hublist = array(); + foreach($hubs as $hub) + $hublist[] = $hub['hubloc_host']; + + logger('notifier: will notify/deliver to these hubs: ' . print_r($hublist,true), LOGGER_DEBUG); $interval = ((get_config('system','delivery_interval') !== false) ? intval(get_config('system','delivery_interval')) : 2 ); @@ -418,12 +431,16 @@ function notifier_run($argv, $argc){ if(count($deliver)) { proc_run('php','include/deliver.php',$deliver); } + + logger('notifier: basic loop complete.', LOGGER_DEBUG); if($normal_mode) call_hooks('notifier_normal',$target_item); + call_hooks('notifier_end',$target_item); + logger('notifer: complete.'); return; } |