diff options
author | mrjive <mrjive@mrjive.it> | 2015-10-26 21:55:47 +0100 |
---|---|---|
committer | mrjive <mrjive@mrjive.it> | 2015-10-26 21:55:47 +0100 |
commit | a4c3058f845a1c38d06b2201a10700c5f878366d (patch) | |
tree | bab86468397e523457ba25199cb9a67265980e00 /include/network.php | |
parent | 32522b61f235266384c81c0669fceaf58afeb4fe (diff) | |
parent | 6cb7afcbc0447b60de0128f9a912e10ae125ba45 (diff) | |
download | volse-hubzilla-a4c3058f845a1c38d06b2201a10700c5f878366d.tar.gz volse-hubzilla-a4c3058f845a1c38d06b2201a10700c5f878366d.tar.bz2 volse-hubzilla-a4c3058f845a1c38d06b2201a10700c5f878366d.zip |
Merge pull request #7 from redmatrix/master
updating from original codebase
Diffstat (limited to 'include/network.php')
-rw-r--r-- | include/network.php | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/include/network.php b/include/network.php index 41e1ff37c..c67c019ef 100644 --- a/include/network.php +++ b/include/network.php @@ -586,7 +586,7 @@ function scale_external_images($s, $include_link = true, $scale_replace = false) if(substr($mtch[1],0,1) == '=') { $owidth = intval(substr($mtch[2],1)); - if(intval($owidth) > 0 && intval($owidth) < 640) + if(intval($owidth) > 0 && intval($owidth) < 1024) continue; } @@ -624,9 +624,9 @@ function scale_external_images($s, $include_link = true, $scale_replace = false) $orig_width = $ph->getWidth(); $orig_height = $ph->getHeight(); - if($orig_width > 640 || $orig_height > 640) { + if($orig_width > 1024 || $orig_height > 1024) { $tag = (($match[1] == 'z') ? 'zmg' : 'img'); - $ph->scaleImage(640); + $ph->scaleImage(1024); $new_width = $ph->getWidth(); $new_height = $ph->getHeight(); logger('scale_external_images: ' . $orig_width . '->' . $new_width . 'w ' . $orig_height . '->' . $new_height . 'h' . ' match: ' . $mtch[0], LOGGER_DEBUG); @@ -1677,13 +1677,40 @@ function format_and_send_email($sender,$xchan,$item) { 'additionalMailHeader' => '', )); +} + +function do_delivery($deliveries) { + if(! (is_array($deliveries) && count($deliveries))) + return; + $interval = ((get_config('system','delivery_interval') !== false) + ? intval(get_config('system','delivery_interval')) : 2 ); + $deliveries_per_process = intval(get_config('system','delivery_batch_count')); + if($deliveries_per_process <= 0) + $deliveries_per_process = 1; + $deliver = array(); + foreach($deliveries as $d) { + $deliver[] = $d; + + if(count($deliver) >= $deliveries_per_process) { + proc_run('php','include/deliver.php',$deliver); + $deliver = array(); + if($interval) + @time_sleep_until(microtime(true) + (float) $interval); + } + } + + // catch any stragglers + + if($deliver) + proc_run('php','include/deliver.php',$deliver); + } |