diff --git a/boot.php b/boot.php
index 1c656b3da2..15e2d5c06e 100644
--- a/boot.php
+++ b/boot.php
@@ -9,7 +9,7 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
-define ( 'FRIENDICA_VERSION', '2.3.1334' );
+define ( 'FRIENDICA_VERSION', '2.3.1335' );
define ( 'DFRN_PROTOCOL_VERSION', '2.23' );
define ( 'DB_UPDATE_VERSION', 1143 );
diff --git a/include/delivery.php b/include/delivery.php
index 28d81226a4..5f84a548ac 100644
--- a/include/delivery.php
+++ b/include/delivery.php
@@ -347,7 +347,10 @@ function delivery_run($argv, $argc){
}
}
- $deliver_status = dfrn_deliver($owner,$contact,$atom);
+ if(! was_recently_delayed($contact['id']))
+ $deliver_status = dfrn_deliver($owner,$contact,$atom);
+ else
+ $deliver_status = (-1);
logger('notifier: dfrn_delivery returns ' . $deliver_status);
@@ -390,7 +393,11 @@ function delivery_run($argv, $argc){
logger('notifier: slapdelivery: ' . $contact['name']);
foreach($slaps as $slappy) {
if($contact['notify']) {
- $deliver_status = slapper($owner,$contact['notify'],$slappy);
+ if(! was_recently_delayed($contact['id']))
+ $deliver_status = slapper($owner,$contact['notify'],$slappy);
+ else
+ $deliver_status = (-1);
+
if($deliver_status == (-1)) {
// queue message for redelivery
add_to_queue($contact['id'],NETWORK_OSTATUS,$slappy);
diff --git a/include/diaspora.php b/include/diaspora.php
index 5069c11275..2051de5fc8 100644
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -2298,14 +2298,20 @@ function diaspora_transmit($owner,$contact,$slap,$public_batch) {
logger('diaspora_transmit: ' . $logid . ' ' . $dest_url);
- if(! intval(get_config('system','diaspora_test')))
- post_url($dest_url . '/', $slap);
- else {
- logger('diaspora_transmit: test_mode');
- return 200;
+ if(was_recently_delayed($contact['id'])) {
+ $return_code = 0;
}
-
- $return_code = $a->get_curl_code();
+ else {
+ if(! intval(get_config('system','diaspora_test'))) {
+ post_url($dest_url . '/', $slap);
+ $return_code = $a->get_curl_code();
+ }
+ else {
+ logger('diaspora_transmit: test_mode');
+ return 200;
+ }
+ }
+
logger('diaspora_transmit: ' . $logid . ' returns: ' . $return_code);
if((! $return_code) || (($return_code == 503) && (stristr($a->get_curl_headers(),'retry-after')))) {
diff --git a/include/onepoll.php b/include/onepoll.php
index 42bce0f685..a64922aa32 100644
--- a/include/onepoll.php
+++ b/include/onepoll.php
@@ -25,6 +25,7 @@ function onepoll_run($argv, $argc){
require_once('include/email.php');
require_once('include/socgraph.php');
require_once('include/pidfile.php');
+ require_once('include/queue_fn.php');
load_config('config');
load_config('system');
@@ -54,6 +55,9 @@ function onepoll_run($argv, $argc){
return;
}
+ if(was_recently_delayed($contact_id))
+ return;
+
$d = datetime_convert();
// Only poll from those with suitable relationships,
@@ -452,7 +456,7 @@ function onepoll_run($argv, $argc){
if($xml) {
logger('poller: received xml : ' . $xml, LOGGER_DATA);
- if(! strstr($xml,' UTC_TIMESTAMP() - interval 15 minute limit 1",
+ intval($cid)
+ );
+ if(count($r))
+ return true;
+ return false;
+}
+
function add_to_queue($cid,$network,$msg,$batch = false) {
diff --git a/mod/admin.php b/mod/admin.php
index cfe5a2dd2c..2810c8a8ab 100644
--- a/mod/admin.php
+++ b/mod/admin.php
@@ -243,6 +243,7 @@ function admin_page_site_post(&$a){
$proxy = ((x($_POST,'proxy')) ? notags(trim($_POST['proxy'])) : '');
$timeout = ((x($_POST,'timeout')) ? intval(trim($_POST['timeout'])) : 60);
$delivery_interval = ((x($_POST,'delivery_interval'))? intval(trim($_POST['delivery_interval'])) : 0);
+ $poll_interval = ((x($_POST,'poll_interval'))? intval(trim($_POST['poll_interval'])) : 0);
$maxloadavg = ((x($_POST,'maxloadavg')) ? intval(trim($_POST['maxloadavg'])) : 50);
$dfrn_only = ((x($_POST,'dfrn_only')) ? True : False);
$ostatus_disabled = !((x($_POST,'ostatus_disabled')) ? True : False);
@@ -291,6 +292,7 @@ function admin_page_site_post(&$a){
}
set_config('system','ssl_policy',$ssl_policy);
set_config('system','delivery_interval',$delivery_interval);
+ set_config('system','poll_interval',$poll_interval);
set_config('system','maxloadavg',$maxloadavg);
set_config('config','sitename',$sitename);
if ($banner==""){
@@ -436,6 +438,7 @@ function admin_page_site(&$a) {
'$proxy' => array('proxy', t("Proxy URL"), get_config('system','proxy'), ""),
'$timeout' => array('timeout', t("Network timeout"), (x(get_config('system','curl_timeout'))?get_config('system','curl_timeout'):60), t("Value is in seconds. Set to 0 for unlimited (not recommended).")),
'$delivery_interval' => array('delivery_interval', t("Delivery interval"), (x(get_config('system','delivery_interval'))?get_config('system','delivery_interval'):2), t("Delay background delivery processes by this many seconds to reduce system load. Recommend: 4-5 for shared hosts, 2-3 for virtual private servers. 0-1 for large dedicated servers.")),
+ '$poll_interval' => array('poll_interval', t("Poll interval"), (x(get_config('system','poll_interval'))?get_config('system','poll_interval'):2), t("Delay background polling processes by this many seconds to reduce system load. If 0, use delivery interval.")),
'$maxloadavg' => array('maxloadavg', t("Maximum Load Average"), ((intval(get_config('system','maxloadavg')) > 0)?get_config('system','maxloadavg'):50), t("Maximum system load before delivery and poll processes are deferred - default 50.")),
'$form_security_token' => get_form_security_token("admin_site"),
diff --git a/mod/follow.php b/mod/follow.php
index ae8cb200c7..4a7f99bf09 100644
--- a/mod/follow.php
+++ b/mod/follow.php
@@ -10,7 +10,10 @@ function follow_init(&$a) {
// NOTREACHED
}
+ $uid = local_user();
$url = $orig_url = notags(trim($_REQUEST['url']));
+ $return_url = $_SESSION['return_url'];
+
// remove ajax junk, e.g. Twitter
@@ -18,19 +21,25 @@ function follow_init(&$a) {
if(! allowed_url($url)) {
notice( t('Disallowed profile URL.') . EOL);
- goaway($_SESSION['return_url']);
+ goaway($return_url);
// NOTREACHED
}
if(! $url) {
notice( t('Connect URL missing.') . EOL);
- goaway($_SESSION['return_url']);
+ goaway($return_url);
// NOTREACHED
}
+ $arr = array('url' => $url, 'contact' => array());
- $ret = probe_url($url);
+ call_hooks('follow', $arr);
+
+ if(x($arr['contact'],'name'))
+ $ret = $arr['contact'];
+ else
+ $ret = probe_url($url);
if($ret['network'] === NETWORK_DFRN) {
if(strlen($a->path))
@@ -46,11 +55,11 @@ function follow_init(&$a) {
if(get_config('system','dfrn_only')) {
notice( t('This site is not configured to allow communications with other networks.') . EOL);
notice( t('No compatible communication protocols or feeds were discovered.') . EOL);
- goaway($_SESSION['return_url']);
+ goaway($return_url);
}
}
- // This just confuses things, remove it
+ // This extra param just confuses things, remove it
if($ret['network'] === NETWORK_DIASPORA)
$ret['url'] = str_replace('?absolute=true','',$ret['url']);
@@ -65,9 +74,11 @@ function follow_init(&$a) {
notice( t('An author or name was not found.') . EOL);
if(! x($ret,'url'))
notice( t('No browser URL could be matched to this address.') . EOL);
- if(strpos($url,'@') !== false)
- notice('Unable to match @-style Identity Address with a known protocol or email contact');
- goaway($_SESSION['return_url']);
+ if(strpos($url,'@') !== false) {
+ notice( t('Unable to match @-style Identity Address with a known protocol or email contact.') . EOL);
+ notice( t('Use mailto: in front of address to force email check.') . EOL);
+ }
+ goaway($return_url);
}
if($ret['network'] === NETWORK_OSTATUS && get_config('system','ostatus_disabled')) {
@@ -94,7 +105,7 @@ function follow_init(&$a) {
// indirect links or webfinger links
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `poll` = '%s' LIMIT 1",
- intval(local_user()),
+ intval($uid),
dbesc($ret['poll'])
);
@@ -104,7 +115,7 @@ function follow_init(&$a) {
q("UPDATE `contact` SET `rel` = %d , `readonly` = 0 WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval(CONTACT_IS_FRIEND),
intval($r[0]['id']),
- intval(local_user())
+ intval($uid)
);
}
}
@@ -118,7 +129,7 @@ function follow_init(&$a) {
$r = q("INSERT INTO `contact` ( `uid`, `created`, `url`, `nurl`, `addr`, `alias`, `batch`, `notify`, `poll`, `poco`, `name`, `nick`, `photo`, `network`, `pubkey`, `rel`, `priority`,
`writable`, `hidden`, `blocked`, `readonly`, `pending` )
VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, 0, 0, 0 ) ",
- intval(local_user()),
+ intval($uid),
dbesc(datetime_convert()),
dbesc($ret['url']),
dbesc(normalise_link($ret['url'])),
@@ -142,12 +153,12 @@ function follow_init(&$a) {
$r = q("SELECT * FROM `contact` WHERE `url` = '%s' AND `uid` = %d LIMIT 1",
dbesc($ret['url']),
- intval(local_user())
+ intval($uid)
);
if(! count($r)) {
notice( t('Unable to retrieve contact information.') . EOL);
- goaway($_SESSION['return_url']);
+ goaway($return_url);
// NOTREACHED
}
@@ -156,7 +167,7 @@ function follow_init(&$a) {
require_once("Photo.php");
- $photos = import_profile_photo($ret['photo'],local_user(),$contact_id);
+ $photos = import_profile_photo($ret['photo'],$uid,$contact_id);
$r = q("UPDATE `contact` SET `photo` = '%s',
`thumb` = '%s',
@@ -200,7 +211,7 @@ function follow_init(&$a) {
$r = q("SELECT `contact`.*, `user`.* FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
WHERE `user`.`uid` = %d AND `contact`.`self` = 1 LIMIT 1",
- intval(local_user())
+ intval($uid)
);
if(count($r)) {
@@ -215,9 +226,9 @@ function follow_init(&$a) {
}
}
- if(strstr($_SESSION['return_url'],'contacts'))
+ if(strstr($return_url,'contacts'))
goaway($a->get_baseurl() . '/contacts/' . $contact_id);
- goaway($_SESSION['return_url']);
+ goaway($return_url);
// NOTREACHED
}
diff --git a/util/messages.po b/util/messages.po
index 6ac283127f..9e9ecc4d10 100644
--- a/util/messages.po
+++ b/util/messages.po
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: 2.3.1334\n"
+"Project-Id-Version: 2.3.1335\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-05-06 10:00-0700\n"
+"POT-Creation-Date: 2012-05-07 10:00-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME