]> git.mxchange.org Git - friendica.git/commitdiff
performance enhancements
authorFriendika <info@friendika.com>
Wed, 5 Oct 2011 01:53:56 +0000 (18:53 -0700)
committerFriendika <info@friendika.com>
Wed, 5 Oct 2011 01:53:56 +0000 (18:53 -0700)
boot.php
include/delivery.php
include/items.php
include/notifier.php
mod/pubsub.php

index 77066717721acbdbcf6209de953ef9869c4817f4..65a1b8229d76eebc1c1142e490da7a905c59c1ad 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -8,7 +8,7 @@ require_once("include/pgettext.php");
 require_once('include/nav.php');
 
 define ( 'FRIENDIKA_PLATFORM',     'Free Friendika');
-define ( 'FRIENDIKA_VERSION',      '2.3.1123' );
+define ( 'FRIENDIKA_VERSION',      '2.3.1124' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
 define ( 'DB_UPDATE_VERSION',      1094      );
 
index 46112d78eeb919efb3445c53fa0755f8d15fec02..e06db6d975ef504dbdf4495e2cf029df5b944edd 100644 (file)
@@ -123,7 +123,6 @@ function delivery_run($argv, $argc){
                if( ! ($icontacts && count($icontacts)))
                        return;
 
-
                // avoid race condition with deleting entries
 
                if($items[0]['deleted']) {
@@ -269,7 +268,12 @@ function delivery_run($argv, $argc){
                                if(! $item_contact)
                                        continue;
 
-                               $atom .= atom_entry($item,'text',$item_contact,$owner,true);
+                               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);
 
                        }
 
index dc08fb3db34a647e75e56820571d362f63090e11..93a730d22b68f3bae0bf5305b0b22f19a13f32fe 100644 (file)
@@ -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)) {
                $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;
 
-       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'])) {
                $r = q("UPDATE `contact` SET `hub-verify` = '%s' WHERE `id` = %d LIMIT 1",
index d1cd1cc7399c8f5ba84527407020135e7f21eaff..ceeea23682c8bcde628b02c8f494ae030433bf50 100644 (file)
@@ -360,7 +360,12 @@ function notifier_run($argv, $argc){
                                if(! $contact)
                                        continue;
 
-                               $atom .= atom_entry($item,'text',$contact,$owner,true);
+                               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);
 
                                if(($top_level) && ($public_message) && ($item['author-link'] === $item['owner-link']) && (! $expire)) 
                                        $slaps[] = atom_entry($item,'html',$contact,$owner,true);
index 0c506db008b8511300b4770955093d2831ce440e..93d50ef90e0efb794f2a5a92299190acc670827a 100644 (file)
@@ -69,8 +69,13 @@ function pubsub_init(&$a) {
                // We must initiate an unsubscribe request with a verify_token. 
                // Don't allow outsiders to unsubscribe us.
 
-               if(($hub_mode === 'unsubscribe') && (! strlen($hub_verify))) 
-                       hub_return(false, '');
+               if($hub_mode === 'unsubscribe') {
+                       if(! strlen($hub_verify)) {
+                               logger('pubsub: bogus unsubscribe'); 
+                               hub_return(false, '');
+                       }
+                       logger('pubsub: unsubscribe success');
+               }
 
                $r = q("UPDATE `contact` SET `subhub` = %d WHERE `id` = %d LIMIT 1",
                        intval($subscribe),