From 5c535441188f78d902d810b72b91d32322b63cf0 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 25 Aug 2017 02:58:38 +0000 Subject: [PATCH] Removed external pubsubhubbub URL --- htconfig.php | 4 ---- include/notifier.php | 35 ++++++----------------------------- include/ostatus.php | 19 ++----------------- util/htconfig.vagrant.php | 3 --- view/templates/htconfig.tpl | 4 ---- 5 files changed, 8 insertions(+), 57 deletions(-) diff --git a/htconfig.php b/htconfig.php index f9b50cd4c4..ada7a130b1 100644 --- a/htconfig.php +++ b/htconfig.php @@ -60,10 +60,6 @@ $a->config['system']['maximagesize'] = 800000; $a->config['php_path'] = 'php'; -// PuSH - aka pubsubhubbub URL. This makes delivery of public posts as fast as private posts - -$a->config['system']['huburl'] = '[internal]'; - // Server-to-server private message encryption (RINO) is allowed by default. // Encryption will only be provided if this setting is set to a non zero value // set to 0 to disable, 2 to enable, 1 is deprecated diff --git a/include/notifier.php b/include/notifier.php index 81f55f7101..e5e49cf300 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -205,8 +205,6 @@ function notifier_run(&$argv, &$argc){ $walltowall = ((($top_level) && ($owner['id'] != $items[0]['contact-id'])) ? true : false); - $hub = get_config('system','huburl'); - // Should the post be transmitted to Diaspora? $diaspora_delivery = true; @@ -563,34 +561,13 @@ function notifier_run(&$argv, &$argc){ } // Notify PuSH subscribers (Used for OStatus distribution of regular posts) - if ($push_notify && strlen($hub)) { - $hubs = explode(',', $hub); - if (count($hubs)) { - foreach ($hubs as $h) { - $h = trim($h); - if (! strlen($h)) { - continue; - } + if ($push_notify) { + // Set push flag for PuSH subscribers to this topic, + // they will be notified in queue.php + q("UPDATE `push_subscriber` SET `push` = 1 ". + "WHERE `nickname` = '%s' AND `push` = 0", dbesc($owner['nickname'])); - if ($h === '[internal]') { - // Set push flag for PuSH subscribers to this topic, - // they will be notified in queue.php - q("UPDATE `push_subscriber` SET `push` = 1 ". - "WHERE `nickname` = '%s' AND `push` = 0", dbesc($owner['nickname'])); - - logger('Activating internal PuSH for item '.$item_id, LOGGER_DEBUG); - - } else { - - $params = 'hub.mode=publish&hub.url=' . urlencode( App::get_baseurl() . '/dfrn_poll/' . $owner['nickname'] ); - post_url($h,$params); - logger('publish for item '.$item_id.' ' . $h . ' ' . $params . ' returned ' . $a->get_curl_code()); - } - if (count($hubs) > 1) { - sleep(7); // try and avoid multiple hubs responding at precisely the same time - } - } - } + logger('Activating internal PuSH for item '.$item_id, LOGGER_DEBUG); // Handling the pubsubhubbub requests proc_run(array('priority' => PRIORITY_HIGH, 'created' => $a->queue['created'], 'dont_fork' => true), diff --git a/include/ostatus.php b/include/ostatus.php index 0f7ecd11d6..2412839a80 100644 --- a/include/ostatus.php +++ b/include/ostatus.php @@ -1495,23 +1495,8 @@ class ostatus { * @param object $root XML root element where the hub links are added */ public static function hublinks($doc, $root, $nick) { - $hub = get_config('system','huburl'); - - $hubxml = ''; - if (strlen($hub)) { - $hubs = explode(',', $hub); - if (count($hubs)) { - foreach ($hubs as $h) { - $h = trim($h); - if (! strlen($h)) - continue; - if ($h === '[internal]') { - $h = App::get_baseurl() . '/pubsubhubbub/'.$nick; - } - xml::add_element($doc, $root, "link", "", array("href" => $h, "rel" => "hub")); - } - } - } + $h = App::get_baseurl() . '/pubsubhubbub/'.$nick; + xml::add_element($doc, $root, "link", "", array("href" => $h, "rel" => "hub")); } /** diff --git a/util/htconfig.vagrant.php b/util/htconfig.vagrant.php index c33f9941ef..a889adac6c 100644 --- a/util/htconfig.vagrant.php +++ b/util/htconfig.vagrant.php @@ -47,9 +47,6 @@ $a->config['system']['maximagesize'] = 800000; $a->config['php_path'] = '/usr/bin/php'; -// PuSH - aka pubsubhubbub URL. This makes delivery of public posts as fast as private posts - -$a->config['system']['huburl'] = '[internal]'; // Server-to-server private message encryption (RINO) is allowed by default. // Encryption will only be provided if this setting is true and the diff --git a/view/templates/htconfig.tpl b/view/templates/htconfig.tpl index 6a156012a2..f9771c88da 100644 --- a/view/templates/htconfig.tpl +++ b/view/templates/htconfig.tpl @@ -77,10 +77,6 @@ $a->config['max_import_size'] = 200000; $a->config['system']['maximagesize'] = 800000; -// PuSH - aka pubsubhubbub URL. This makes delivery of public posts as fast as private posts - -$a->config['system']['huburl'] = '[internal]'; - // Server-to-server private message encryption (RINO) is allowed by default. // Encryption will only be provided if this setting is set to a non zero value // set to 0 to disable, 2 to enable, 1 is deprecated