add channel_name to delivery logs because it is a bit more useful than an xchan_hash

This commit is contained in:
friendica 2013-07-15 19:04:23 -07:00
parent 2cfd9a3fa9
commit 4de52e601c
2 changed files with 12 additions and 11 deletions

View File

@ -2051,7 +2051,8 @@ function tgroup_check($uid,$item) {
$terms = get_terms_oftype($item['term'],TERM_MENTION); $terms = get_terms_oftype($item['term'],TERM_MENTION);
logger('tgroup_check: post mentions: ' . print_r($terms,true), LOGGER_DATA); if($terms)
logger('tgroup_check: post mentions: ' . print_r($terms,true), LOGGER_DATA);
$link = normalise_link($a->get_baseurl() . '/channel/' . $u[0]['channel_address']); $link = normalise_link($a->get_baseurl() . '/channel/' . $u[0]['channel_address']);

View File

@ -1036,7 +1036,7 @@ function process_delivery($sender,$arr,$deliveries,$relay) {
if((! perm_is_allowed($channel['channel_id'],$sender['hash'],$perm)) && (! $tag_delivery)) { if((! perm_is_allowed($channel['channel_id'],$sender['hash'],$perm)) && (! $tag_delivery)) {
logger("permission denied for delivery {$channel['channel_id']}"); logger("permission denied for delivery {$channel['channel_id']}");
$result[] = array($d['hash'],'permission denied'); $result[] = array($d['hash'],'permission denied',$channel['channel_name']);
continue; continue;
} }
@ -1051,7 +1051,7 @@ function process_delivery($sender,$arr,$deliveries,$relay) {
if($relay && $item_id) { if($relay && $item_id) {
logger('process_delivery: invoking relay'); logger('process_delivery: invoking relay');
proc_run('php','include/notifier.php','relay',intval($item_id)); proc_run('php','include/notifier.php','relay',intval($item_id));
$result[] = array($d['hash'],'relayed'); $result[] = array($d['hash'],'relayed',$channel['channel_name']);
} }
continue; continue;
@ -1082,7 +1082,7 @@ function process_delivery($sender,$arr,$deliveries,$relay) {
$xyz = event_store($ev); $xyz = event_store($ev);
$result = array($d['hash'],'event processed'); $result = array($d['hash'],'event processed',$channel['channel_name']);
continue; continue;
} }
} }
@ -1099,20 +1099,20 @@ function process_delivery($sender,$arr,$deliveries,$relay) {
$arr['uid'] = $channel['channel_id']; $arr['uid'] = $channel['channel_id'];
update_imported_item($sender,$arr,$channel['channel_id']); update_imported_item($sender,$arr,$channel['channel_id']);
} }
$result[] = array($d['hash'],'updated'); $result[] = array($d['hash'],'updated',$channel['channel_name']);
$item_id = $r[0]['id']; $item_id = $r[0]['id'];
} }
else { else {
$arr['aid'] = $channel['channel_account_id']; $arr['aid'] = $channel['channel_account_id'];
$arr['uid'] = $channel['channel_id']; $arr['uid'] = $channel['channel_id'];
$item_id = item_store($arr); $item_id = item_store($arr);
$result[] = array($d['hash'],(($item_id) ? 'posted' : 'storage failed')); $result[] = array($d['hash'],(($item_id) ? 'posted' : 'storage failed'),$channel['channel_name']);
} }
if($relay && $item_id) { if($relay && $item_id) {
logger('process_delivery: invoking relay'); logger('process_delivery: invoking relay');
proc_run('php','include/notifier.php','relay',intval($item_id)); proc_run('php','include/notifier.php','relay',intval($item_id));
$result[] = array($d['hash'],'relayed'); $result[] = array($d['hash'],'relayed',$channel['channel_name']);
} }
} }
@ -1235,7 +1235,7 @@ function process_mail_delivery($sender,$arr,$deliveries) {
if(! perm_is_allowed($channel['channel_id'],$sender['hash'],'post_mail')) { if(! perm_is_allowed($channel['channel_id'],$sender['hash'],'post_mail')) {
logger("permission denied for mail delivery {$channel['channel_id']}"); logger("permission denied for mail delivery {$channel['channel_id']}");
$result[] = array($d['hash'],'permission denied'); $result[] = array($d['hash'],'permission denied',$channel['channel_name']);
continue; continue;
} }
@ -1249,11 +1249,11 @@ function process_mail_delivery($sender,$arr,$deliveries) {
intval($r[0]['id']), intval($r[0]['id']),
intval($channel['channel_id']) intval($channel['channel_id'])
); );
$result[] = array($d['hash'],'mail recalled'); $result[] = array($d['hash'],'mail recalled',$channel['channel_name']);
logger('mail_recalled'); logger('mail_recalled');
} }
else { else {
$result[] = array($d['hash'],'duplicate mail received'); $result[] = array($d['hash'],'duplicate mail received',$channel['channel_name']);
logger('duplicate mail received'); logger('duplicate mail received');
} }
continue; continue;
@ -1262,7 +1262,7 @@ function process_mail_delivery($sender,$arr,$deliveries) {
$arr['account_id'] = $channel['channel_account_id']; $arr['account_id'] = $channel['channel_account_id'];
$arr['channel_id'] = $channel['channel_id']; $arr['channel_id'] = $channel['channel_id'];
$item_id = mail_store($arr); $item_id = mail_store($arr);
$result[] = array($d['hash'],'mail delivered'); $result[] = array($d['hash'],'mail delivered',$channel['channel_name']);
} }
} }