]> git.mxchange.org Git - friendica.git/commitdiff
pubsubhubbub - discovery and notifier
authorMike Macgirvin <mike@macgirvin.com>
Fri, 1 Oct 2010 03:24:03 +0000 (20:24 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Fri, 1 Oct 2010 03:24:03 +0000 (20:24 -0700)
include/items.php
include/notifier.php
mod/pubsub.php
view/atom_feed.tpl

index 839baf4b6e5110aeb854863aad97bc8c1429c77a..688ef244ab63ed625e5c5fc64ed519b8ef8f76a0 100644 (file)
@@ -123,11 +123,16 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) {
 
        $atom = '';
 
+       $hub = get_config('system','huburl');
+
+       $hubxml = ((strlen($hub)) ? '<link rel="hub" href="' . xmlify($hub) . '" />' . "\n" : '');
+
 
        $atom .= replace_macros($feed_template, array(
                        '$feed_id'      => xmlify($a->get_baseurl() . '/profile/' . $owner_nick),
                        '$feed_title'   => xmlify($owner['name']),
                        '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', $updated . '+00:00' , ATOM_TIME)) ,
+                       '$hub'          => $hubxml,
                        '$name'         => xmlify($owner['name']),
                        '$profile_page' => xmlify($owner['url']),
                        '$photo'        => xmlify($owner['photo']),
index 967f4ff55b5871ad10efd46bf0460f2e8f1343ec..c339d2fb38954fc569ee9d8ae3b174075a943669 100644 (file)
@@ -83,6 +83,8 @@
        else
                killme();
 
+       $hub = get_config('system','huburl');
+
        if($cmd != 'mail') {
 
                require_once('include/group.php');
 
        $atom = '';
 
+       $hubxml = ((strlen($hub)) ? '<link rel="hub" href="' . xmlify($hub) . '" />' . "\n" : '');
+       
 
        $atom .= replace_macros($feed_template, array(
                        '$feed_id'      => xmlify($a->get_baseurl() . '/profile/' . $owner['nickname'] ),
                        '$feed_title'   => xmlify($owner['name']),
                        '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', $updated . '+00:00' , ATOM_TIME)) ,
+                       '$hub'          => $hubxml,
                        '$name'         => xmlify($owner['name']),
                        '$profile_page' => xmlify($owner['url']),
                        '$photo'        => xmlify($owner['photo']),
                }
        }
 
+       if((strlen($hub)) && ($cmd !== 'mail') && (followup == false)) {
+               $params = array('hub.mode' => 'publish', 'hub.url' => $a->get_baseurl() . '/dfrn_poll/' . $owner['nickname'] );
+               post_url($hub,$params);
+       }
+
        killme();
 
index 3a3122d72ae1aad1a10414495a7c3038f8028d03..65705069af126b01b6e2500948e63a6a2c1a5c63 100644 (file)
@@ -104,7 +104,7 @@ function pubsub_post(&$a) {
 
        consume_feed($xml,$importer,$contact);
 
-       hub_post_return();;
+       hub_post_return();
 
 }
 
index 56bd278ea855d34f7648373551f7ddfaea1a5e29..893d42036f84e0f7fe49c996602672d3d3414888 100644 (file)
@@ -10,6 +10,7 @@
   <title>$feed_title</title>
   <generator uri="http://mistpark.com" version="2.0">Mistpark</generator>
   <link rel="license" href="http://creativecommons.org/licenses/by/3.0/" />
+  $hub
 
   <updated>$feed_updated</updated>