]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
High-priority OStatus fixes:
authorBrion Vibber <brion@pobox.com>
Tue, 2 Mar 2010 02:46:34 +0000 (18:46 -0800)
committerBrion Vibber <brion@pobox.com>
Tue, 2 Mar 2010 02:46:34 +0000 (18:46 -0800)
* PuSHing out to multiple client services could fail; only first callback got reached
* Correction for re-sub request to a known sub

plugins/OStatus/actions/pushhub.php
plugins/OStatus/classes/HubSub.php

index f33690bc4999acc89c1974913ea95a59d9d130ef..842d65e7d29d9eac29518249560aa98c3e37a7e7 100644 (file)
@@ -104,7 +104,7 @@ class PushHubAction extends Action
             throw new ClientException("Invalid hub.secret $secret; must be under 200 bytes.");
         }
 
-        $sub = HubSub::staticGet($sub->topic, $sub->callback);
+        $sub = HubSub::staticGet($topic, $callback);
         if (!$sub) {
             // Creating a new one!
             $sub = new HubSub();
index e599d83a967bf3a8e69551f37dad8fde5c0a455f..3120a70f9fb39dd978c14482c59b79ed90abbbc4 100644 (file)
@@ -260,9 +260,15 @@ class HubSub extends Memcached_DataObject
             $retries = intval(common_config('ostatus', 'hub_retries'));
         }
 
-        $data = array('sub' => clone($this),
+        // We dare not clone() as when the clone is discarded it'll
+        // destroy the result data for the parent query.
+        // @fixme use clone() again when it's safe to copy an
+        // individual item from a multi-item query again.
+        $sub = HubSub::staticGet($this->topic, $this->callback);
+        $data = array('sub' => $sub,
                       'atom' => $atom,
                       'retries' => $retries);
+        common_log(LOG_INFO, "Queuing PuSH: $this->topic to $this->callback");
         $qm = QueueManager::get();
         $qm->enqueue($data, 'hubout');
     }