performance enhancements
This commit is contained in:
parent
24595c55d7
commit
7b648e6da8
2
boot.php
2
boot.php
|
@ -8,7 +8,7 @@ require_once("include/pgettext.php");
|
||||||
require_once('include/nav.php');
|
require_once('include/nav.php');
|
||||||
|
|
||||||
define ( 'FRIENDIKA_PLATFORM', 'Free Friendika');
|
define ( 'FRIENDIKA_PLATFORM', 'Free Friendika');
|
||||||
define ( 'FRIENDIKA_VERSION', '2.3.1123' );
|
define ( 'FRIENDIKA_VERSION', '2.3.1124' );
|
||||||
define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
|
define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
|
||||||
define ( 'DB_UPDATE_VERSION', 1094 );
|
define ( 'DB_UPDATE_VERSION', 1094 );
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,6 @@ function delivery_run($argv, $argc){
|
||||||
if( ! ($icontacts && count($icontacts)))
|
if( ! ($icontacts && count($icontacts)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
// avoid race condition with deleting entries
|
// avoid race condition with deleting entries
|
||||||
|
|
||||||
if($items[0]['deleted']) {
|
if($items[0]['deleted']) {
|
||||||
|
@ -269,6 +268,11 @@ function delivery_run($argv, $argc){
|
||||||
if(! $item_contact)
|
if(! $item_contact)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if($normal_mode) {
|
||||||
|
if($item_id == $item['id'])
|
||||||
|
$atom .= atom_entry($item,'text',$item_contact,$owner,true);
|
||||||
|
}
|
||||||
|
else
|
||||||
$atom .= atom_entry($item,'text',$item_contact,$owner,true);
|
$atom .= atom_entry($item,'text',$item_contact,$owner,true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1663,7 +1663,7 @@ function lose_sharer($importer,$contact,$datarray,$item) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function subscribe_to_hub($url,$importer,$contact,$submode = 'subscribe') {
|
function subscribe_to_hub($url,$importer,$contact,$hubmode = 'subscribe') {
|
||||||
|
|
||||||
if(is_array($importer)) {
|
if(is_array($importer)) {
|
||||||
$r = q("SELECT `nickname` FROM `user` WHERE `uid` = %d LIMIT 1",
|
$r = q("SELECT `nickname` FROM `user` WHERE `uid` = %d LIMIT 1",
|
||||||
|
@ -1686,7 +1686,7 @@ function subscribe_to_hub($url,$importer,$contact,$submode = 'subscribe') {
|
||||||
|
|
||||||
$params= 'hub.mode=' . $hubmode . '&hub.callback=' . urlencode($push_url) . '&hub.topic=' . urlencode($contact['poll']) . '&hub.verify=async&hub.verify_token=' . $verify_token;
|
$params= 'hub.mode=' . $hubmode . '&hub.callback=' . urlencode($push_url) . '&hub.topic=' . urlencode($contact['poll']) . '&hub.verify=async&hub.verify_token=' . $verify_token;
|
||||||
|
|
||||||
logger('subscribe_to_hub: subscribing ' . $contact['name'] . ' to hub ' . $url . ' with verifier ' . $verify_token);
|
logger('subscribe_to_hub: ' . $hubmode . ' ' . $contact['name'] . ' to hub ' . $url . ' endpoint: ' . $push_url . ' with verifier ' . $verify_token);
|
||||||
|
|
||||||
if(! strlen($contact['hub-verify'])) {
|
if(! strlen($contact['hub-verify'])) {
|
||||||
$r = q("UPDATE `contact` SET `hub-verify` = '%s' WHERE `id` = %d LIMIT 1",
|
$r = q("UPDATE `contact` SET `hub-verify` = '%s' WHERE `id` = %d LIMIT 1",
|
||||||
|
|
|
@ -360,6 +360,11 @@ function notifier_run($argv, $argc){
|
||||||
if(! $contact)
|
if(! $contact)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if($normal_mode) {
|
||||||
|
if($item_id == $item['id'])
|
||||||
|
$atom .= atom_entry($item,'text',$contact,$owner,true);
|
||||||
|
}
|
||||||
|
else
|
||||||
$atom .= atom_entry($item,'text',$contact,$owner,true);
|
$atom .= atom_entry($item,'text',$contact,$owner,true);
|
||||||
|
|
||||||
if(($top_level) && ($public_message) && ($item['author-link'] === $item['owner-link']) && (! $expire))
|
if(($top_level) && ($public_message) && ($item['author-link'] === $item['owner-link']) && (! $expire))
|
||||||
|
|
|
@ -69,8 +69,13 @@ function pubsub_init(&$a) {
|
||||||
// We must initiate an unsubscribe request with a verify_token.
|
// We must initiate an unsubscribe request with a verify_token.
|
||||||
// Don't allow outsiders to unsubscribe us.
|
// Don't allow outsiders to unsubscribe us.
|
||||||
|
|
||||||
if(($hub_mode === 'unsubscribe') && (! strlen($hub_verify)))
|
if($hub_mode === 'unsubscribe') {
|
||||||
|
if(! strlen($hub_verify)) {
|
||||||
|
logger('pubsub: bogus unsubscribe');
|
||||||
hub_return(false, '');
|
hub_return(false, '');
|
||||||
|
}
|
||||||
|
logger('pubsub: unsubscribe success');
|
||||||
|
}
|
||||||
|
|
||||||
$r = q("UPDATE `contact` SET `subhub` = %d WHERE `id` = %d LIMIT 1",
|
$r = q("UPDATE `contact` SET `subhub` = %d WHERE `id` = %d LIMIT 1",
|
||||||
intval($subscribe),
|
intval($subscribe),
|
||||||
|
|
Loading…
Reference in a new issue