mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 05:35:12 +00:00
Merge remote-tracking branch 'mike/master' into dev
This commit is contained in:
commit
41749f5eda
6 changed files with 62 additions and 5 deletions
|
@ -12,6 +12,7 @@ class Queue {
|
|||
require_once('include/items.php');
|
||||
require_once('include/bbcode.php');
|
||||
|
||||
|
||||
if(argc() > 1)
|
||||
$queue_id = argv(1);
|
||||
else
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
namespace Zotlabs\Module;
|
||||
|
||||
require_once('include/conversation.php');
|
||||
require_once('include/acl_selectors.php');
|
||||
|
||||
|
||||
class Pubstream extends \Zotlabs\Web\Controller {
|
||||
|
@ -33,6 +34,47 @@ class Pubstream extends \Zotlabs\Web\Controller {
|
|||
$static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0);
|
||||
$net = ((array_key_exists('net',$_REQUEST)) ? escape_tags($_REQUEST['net']) : '');
|
||||
|
||||
|
||||
if(local_channel() && (! $update)) {
|
||||
|
||||
$channel = \App::get_channel();
|
||||
|
||||
$channel_acl = array(
|
||||
'allow_cid' => $channel['channel_allow_cid'],
|
||||
'allow_gid' => $channel['channel_allow_gid'],
|
||||
'deny_cid' => $channel['channel_deny_cid'],
|
||||
'deny_gid' => $channel['channel_deny_gid']
|
||||
);
|
||||
|
||||
$x = array(
|
||||
'is_owner' => true,
|
||||
'allow_location' => ((intval(get_pconfig($channel['channel_id'],'system','use_browser_location'))) ? '1' : ''),
|
||||
'default_location' => $channel['channel_location'],
|
||||
'nickname' => $channel['channel_address'],
|
||||
'lockstate' => (($group || $cid || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
|
||||
|
||||
'acl' => populate_acl($channel_acl),
|
||||
'permissions' => $channel_acl,
|
||||
'bang' => '',
|
||||
'visitor' => true,
|
||||
'profile_uid' => local_channel(),
|
||||
'return_path' => 'channel/' . $channel['channel_address'],
|
||||
'expanded' => true,
|
||||
'editor_autocomplete' => true,
|
||||
'bbco_autocomplete' => 'bbcode',
|
||||
'bbcode' => true,
|
||||
'jotnets' => true
|
||||
);
|
||||
|
||||
$o = '<div id="jot-popup">';
|
||||
$o .= status_editor($a,$x);
|
||||
$o .= '</div>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(! $update && !$load) {
|
||||
|
||||
|
|
|
@ -1433,14 +1433,19 @@ function scrape_feed($url) {
|
|||
|
||||
|
||||
|
||||
function do_delivery($deliveries) {
|
||||
|
||||
|
||||
function do_delivery($deliveries, $force = false) {
|
||||
|
||||
// $force is set if a site that wasn't responding suddenly returns to life.
|
||||
// Try and shove through everything going to that site while it's responding.
|
||||
|
||||
if(! (is_array($deliveries) && count($deliveries)))
|
||||
return;
|
||||
|
||||
|
||||
$x = q("select count(outq_hash) as total from outq where outq_delivered = 0");
|
||||
if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300))) {
|
||||
if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300)) && (! $force)) {
|
||||
logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
|
||||
foreach($deliveries as $d) {
|
||||
update_queue_item($d);
|
||||
|
|
|
@ -42,7 +42,7 @@ function update_queue_item($id, $add_priority = 0) {
|
|||
$next = datetime_convert('UTC','UTC','now + 1 hour');
|
||||
}
|
||||
else {
|
||||
$next = datetime_convert('UTC','UTC','now + 15 minutes');
|
||||
$next = datetime_convert('UTC','UTC','now + ' . intval($add_priority) . ' minutes');
|
||||
}
|
||||
|
||||
q("UPDATE outq SET outq_updated = '%s',
|
||||
|
@ -200,14 +200,15 @@ function queue_deliver($outq, $immediate = false) {
|
|||
}
|
||||
}
|
||||
if($piled_up) {
|
||||
do_delivery($piled_up);
|
||||
// call do_delivery() with the force flag
|
||||
do_delivery($piled_up, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
logger('deliver: queue post returned ' . $result['return_code']
|
||||
. ' from ' . $outq['outq_posturl'],LOGGER_DEBUG);
|
||||
update_queue_item($outq['outq_hash']);
|
||||
update_queue_item($outq['outq_hash'],10);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
3
view/css/mod_pubstream.css
Normal file
3
view/css/mod_pubstream.css
Normal file
|
@ -0,0 +1,3 @@
|
|||
#jot-popup {
|
||||
display: none;
|
||||
}
|
5
view/js/mod_pubstream.js
Normal file
5
view/js/mod_pubstream.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
$(document).ready(function() {
|
||||
$(".comment-edit-wrapper textarea").editor_autocomplete(baseurl+"/acl?f=&n=1");
|
||||
// make auto-complete work in more places
|
||||
$(".wall-item-comment-wrapper textarea").editor_autocomplete(baseurl+"/acl?f=&n=1");
|
||||
});
|
Loading…
Reference in a new issue