diff options
author | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2016-02-12 06:28:40 +0100 |
---|---|---|
committer | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2016-02-12 06:28:40 +0100 |
commit | ac4a8fde3a662f4f8918177ae4e5decefdc2ad11 (patch) | |
tree | d8929c45e08c903ae92366756ce408d01a676e29 /include | |
parent | 95c686de6edd5d5e6b85a5f283770441fb7852ea (diff) | |
parent | 31aaf40ade183c91e8691ef7361237f87d713fd2 (diff) | |
download | volse-hubzilla-ac4a8fde3a662f4f8918177ae4e5decefdc2ad11.tar.gz volse-hubzilla-ac4a8fde3a662f4f8918177ae4e5decefdc2ad11.tar.bz2 volse-hubzilla-ac4a8fde3a662f4f8918177ae4e5decefdc2ad11.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include')
-rwxr-xr-x | include/dba/dba_driver.php | 1 | ||||
-rwxr-xr-x | include/items.php | 17 | ||||
-rw-r--r-- | include/notifier.php | 34 | ||||
-rwxr-xr-x | include/plugin.php | 2 | ||||
-rw-r--r-- | include/queue_fn.php | 2 |
5 files changed, 46 insertions, 10 deletions
diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php index 1fb3d5c00..2219b43cb 100755 --- a/include/dba/dba_driver.php +++ b/include/dba/dba_driver.php @@ -388,3 +388,4 @@ function db_getfunc($f) { logger('Unable to abstract DB function "'. $f . '" for dbtype ' . ACTIVE_DBTYPE, LOGGER_DEBUG); return $f; } + diff --git a/include/items.php b/include/items.php index 5361a5fde..1231b6209 100755 --- a/include/items.php +++ b/include/items.php @@ -552,6 +552,12 @@ function get_public_feed($channel, $params) { $params['top'] = ((x($params,'top')) ? intval($params['top']) : 0); $params['cat'] = ((x($params,'cat')) ? $params['cat'] : ''); + + // put a sane lower limit on feed requests if not specified + + if($params['begin'] === NULL_DATE) + $params['begin'] = datetime_convert('UTC','UTC','now - 1 month'); + switch($params['type']) { case 'json': header("Content-type: application/atom+json"); @@ -587,8 +593,8 @@ function get_feed_for($channel, $observer_hash, $params) { } $items = items_fetch(array( 'wall' => '1', - 'datequery' => $params['begin'], - 'datequery2' => $params['end'], + 'datequery' => $params['end'], + 'datequery2' => $params['begin'], 'start' => $params['start'], // FIXME 'records' => $params['records'], // FIXME 'direction' => $params['direction'], // FIXME @@ -623,6 +629,7 @@ function get_feed_for($channel, $observer_hash, $params) { '$community' => '', )); + call_hooks('atom_feed', $atom); if($items) { @@ -4901,15 +4908,15 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C } if ($arr['datequery']) { - $sql_extra3 .= protect_sprintf(sprintf(" AND item.created <= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$arr['datequery'])))); + $sql_extra3 .= protect_sprintf(sprintf(" AND item.created <= '%s' ", dbesc(datetime_convert('UTC','UTC',$arr['datequery'])))); } if ($arr['datequery2']) { - $sql_extra3 .= protect_sprintf(sprintf(" AND item.created >= '%s' ", dbesc(datetime_convert(date_default_timezone_get(),'',$arr['datequery2'])))); + $sql_extra3 .= protect_sprintf(sprintf(" AND item.created >= '%s' ", dbesc(datetime_convert('UTC','UTC',$arr['datequery2'])))); } if(! array_key_exists('nouveau',$arr)) { $sql_extra2 = " AND item.parent = item.id "; - $sql_extra3 = ''; +// $sql_extra3 = ''; } if($arr['search']) { diff --git a/include/notifier.php b/include/notifier.php index 5260e629f..93cc77a1c 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -423,6 +423,7 @@ function notifier_run($argv, $argc){ $details = q("select xchan_hash, xchan_instance_url, xchan_network, xchan_addr, xchan_guid, xchan_guid_sig from xchan where xchan_hash in (" . implode(',',$recipients) . ")"); + $recip_list = array(); if($details) { @@ -437,12 +438,39 @@ function notifier_run($argv, $argc){ if(! $delivery_options) format_and_send_email($channel,$d,$target_item); } + } + } - - } + $narr = array( + 'channel' => $channel, + 'env_recips' => $env_recips, + 'packet_recips' => $packet_recips, + 'recipients' => $recipients, + 'item' => $item, + 'target_item' => $target_item, + 'top_level_post' => $top_level_post, + 'private' => $private, + 'followup' => $followup, + 'relay_to_owner' => $relay_to_owner, + 'uplink' => $uplink, + 'cmd' => $cmd, + 'mail' => $mail, + 'location' => $location, + 'request' => $request, + 'normal_mode' => $normal_mode, + 'packet_type' => $packet_type, + 'walltowall' => $walltowall, + 'queued' => array() + ); + + call_hooks('notifier_process', $narr); + if($narr['queued']) { + foreach($narr['queued'] as $pq) + $deliveries[] = $pq; } + if(($private) && (! $env_recips)) { // shouldn't happen logger('notifier: private message with no envelope recipients.' . print_r($argv,true), LOGGER_NORMAL, LOG_NOTICE); @@ -504,7 +532,7 @@ function notifier_run($argv, $argc){ } logger('notifier: will notify/deliver to these hubs: ' . print_r($hublist,true), LOGGER_DEBUG, LOG_DEBUG); - + foreach($dhubs as $hub) { diff --git a/include/plugin.php b/include/plugin.php index a47558b63..da4568ad7 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -291,7 +291,7 @@ function call_hooks($name, &$data = null) { $func = $hook[1]; $func($a, $data); } else { - // remove orphan hooks + q("DELETE FROM hook WHERE hook = '%s' AND file = '%s' AND function = '%s'", dbesc($name), dbesc($hook[0]), diff --git a/include/queue_fn.php b/include/queue_fn.php index 0708aab56..3112a832b 100644 --- a/include/queue_fn.php +++ b/include/queue_fn.php @@ -101,7 +101,7 @@ function queue_deliver($outq, $immediate = false) { } } - $arr = array('outq' => $outq, 'handled' => false, 'immediate' => $immediate); + $arr = array('outq' => $outq, 'base' => $base, 'handled' => false, 'immediate' => $immediate); call_hooks('queue_deliver',$arr); if($arr['handled']) return; |