]> git.mxchange.org Git - friendica.git/blobdiff - include/pubsubpublish.php
Bugfix for pull request #2147 (Fix for issue #2122)
[friendica.git] / include / pubsubpublish.php
index bc81fd78680c16cf0b429abeb557aa6b59727c87..d27beea3d5ea7683a771afd319b54fac3abd571a 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 require_once("boot.php");
+require_once("include/ostatus.php");
 
 function handle_pubsubhubbub() {
        global $a, $db;
@@ -12,17 +13,17 @@ function handle_pubsubhubbub() {
        $r = q("SELECT * FROM `push_subscriber` WHERE `push` > 0");
 
        foreach($r as $rr) {
-               $params = get_feed_for($a, '', $rr['nickname'], $rr['last_update'], 0, true);
+               //$params = get_feed_for($a, '', $rr['nickname'], $rr['last_update'], 0, true);
+               $params = ostatus_feed($a, $rr['nickname'], $rr['last_update']);
                $hmac_sig = hash_hmac("sha1", $params, $rr['secret']);
 
                $headers = array("Content-type: application/atom+xml",
-                                               sprintf("Link: <%s>;rel=hub," .
-                                                               "<%s>;rel=self",
-                                                               $a->get_baseurl() . '/pubsubhubbub',
-                                                               $rr['topic']),
-                                               "X-Hub-Signature: sha1=" . $hmac_sig);
+                               sprintf("Link: <%s>;rel=hub,<%s>;rel=self",
+                                       $a->get_baseurl().'/pubsubhubbub',
+                                       $rr['topic']),
+                               "X-Hub-Signature: sha1=".$hmac_sig);
 
-               logger('POST '. print_r($headers, true)."\n".$params, LOGGER_DEBUG);
+               logger('POST '.print_r($headers, true)."\n".$params, LOGGER_DEBUG);
 
                post_url($rr['callback_url'], $params, $headers);
                $ret = $a->get_curl_code();