diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/deliver.php | 12 | ||||
-rwxr-xr-x | include/items.php | 7 | ||||
-rw-r--r-- | include/notifier.php | 2 | ||||
-rw-r--r-- | include/text.php | 11 | ||||
-rw-r--r-- | include/zot.php | 8 |
5 files changed, 23 insertions, 17 deletions
diff --git a/include/deliver.php b/include/deliver.php index 11c1b249e..de93e316e 100644 --- a/include/deliver.php +++ b/include/deliver.php @@ -107,15 +107,10 @@ function deliver_run($argv, $argc) { $notify = json_decode($r[0]['outq_notify'],true); - // Check if this is a conversation request packet. It won't have outq_msg - // but will be an encrypted packet - so will need to be handed off to - // web delivery rather than processed inline. + // Messages without an outq_msg will need to go via the web, even if it's a + // local delivery. This includes conversation requests and refresh packets. - $sendtoweb = false; - if(array_key_exists('iv',$notify) && (! $r[0]['outq_msg'])) - $sendtoweb = true; - - if(($r[0]['outq_posturl'] === z_root() . '/post') && (! $sendtoweb)) { + if(($r[0]['outq_posturl'] === z_root() . '/post') && ($r[0]['outq_msg'])) { logger('deliver: local delivery', LOGGER_DEBUG); // local delivery // we should probably batch these and save a few delivery processes @@ -166,6 +161,7 @@ function deliver_run($argv, $argc) { } else { logger('deliver: remote zot delivery failed to ' . $r[0]['outq_posturl']); + logger('deliver: remote zot delivery fail data: ' . print_r($result,true), LOGGER_DATA); $y = q("update outq set outq_updated = '%s' where outq_hash = '%s'", dbesc(datetime_convert()), dbesc($argv[$x]) diff --git a/include/items.php b/include/items.php index 3e4805212..43bbdda28 100755 --- a/include/items.php +++ b/include/items.php @@ -2962,9 +2962,12 @@ function tag_deliver($uid, $item_id) { if(($item['source_xchan']) && intval($item['item_uplink']) && intval($item['item_thread_top']) && ($item['edited'] != $item['created'])) { + // this is an update (edit) to a post which was already processed by us and has a second delivery chain // Just start the second delivery chain to deliver the updated post - proc_run('php','include/notifier.php','tgroup',$item['id']); + // after resetting ownership and permission bits + + start_delivery_chain($u[0], $item, $item_id, 0); return; } @@ -3181,7 +3184,7 @@ function tag_deliver($uid, $item_id) { } if((! $mention) && (! $union)) { - logger('tag_deliver: no mention and no union.'); + logger('tag_deliver: no mention for ' . $u[0]['channel_name'] . ' and no union.'); return; } diff --git a/include/notifier.php b/include/notifier.php index 34a527e15..b7830285a 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -101,7 +101,7 @@ function notifier_run($argv, $argc){ $dead_hubs = array(); $dh = q("select site_url from site where site_dead = 1"); - if(dh) { + if($dh) { foreach($dh as $dead) { $dead_hubs[] = $dead['site_url']; } diff --git a/include/text.php b/include/text.php index ed0e21a71..4053c15b2 100644 --- a/include/text.php +++ b/include/text.php @@ -531,11 +531,12 @@ function attribute_contains($attr, $s) { * LOGGER_DATA and LOGGER_ALL. * * Since PHP5.4 we get the file, function and line automatically where the logger - * was caleld, so no need to add it to the message anymore. + * was called, so no need to add it to the message anymore. * * @param string $msg Message to log * @param int $level A log level. */ + function logger($msg, $level = 0) { // turn off logger in install mode global $a; @@ -557,7 +558,13 @@ function logger($msg, $level = 0) { $where = basename($stack[0]['file']) . ':' . $stack[0]['line'] . ':' . $stack[1]['function'] . ': '; } - @file_put_contents($logfile, datetime_convert() . ':' . session_id() . ' ' . $where . $msg . PHP_EOL, FILE_APPEND); + $s = datetime_convert() . ':' . session_id() . ' ' . $where . $msg . PHP_EOL; + $pluginfo = array('filename' => $logfile, 'loglevel' => $level, 'message' => $s,'logged' => false); + + call_hooks('logger',$pluginfo); + + if(! $pluginfo['logged']) + @file_put_contents($pluginfo['filename'], $pluginfo['message'], FILE_APPEND); } /** diff --git a/include/zot.php b/include/zot.php index d5d68f72c..0a1a8ee51 100644 --- a/include/zot.php +++ b/include/zot.php @@ -745,8 +745,8 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED, $ud_arr = null) { || ($r[0]['xchan_follow'] != $arr['follow_url']) || ($r[0]['xchan_connpage'] != $arr['connect_url']) || ($r[0]['xchan_url'] != $arr['url']) - || $hidden_changed || adult_changed || deleted_changed || $pubforum_changed ) { - $r = q("update xchan set xchan_name = '%s', xchan_name_date = '%s', xchan_connurl = '%s', xchan_follow = '%s', + || $hidden_changed || $adult_changed || $deleted_changed || $pubforum_changed ) { + $rup = q("update xchan set xchan_name = '%s', xchan_name_date = '%s', xchan_connurl = '%s', xchan_follow = '%s', xchan_connpage = '%s', xchan_hidden = %d, xchan_selfcensored = %d, xchan_deleted = %d, xchan_pubforum = %d, xchan_addr = '%s', xchan_url = '%s' where xchan_hash = '%s'", dbesc(($arr['name']) ? $arr['name'] : '-'), @@ -763,8 +763,8 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED, $ud_arr = null) { dbesc($xchan_hash) ); - logger('import_xchan: existing: ' . print_r($r[0],true), LOGGER_DATA); - logger('import_xchan: new: ' . print_r($arr,true), LOGGER_DATA); + logger('import_xchan: update: existing: ' . print_r($r[0],true), LOGGER_DATA); + logger('import_xchan: update: new: ' . print_r($arr,true), LOGGER_DATA); $what .= 'xchan '; $changed = true; } |