]> git.mxchange.org Git - friendica.git/commitdiff
OStatus: Fix PubSubHubBub subscription
authorMichael <heluecht@pirati.ca>
Sun, 8 Jan 2023 09:41:54 +0000 (09:41 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 8 Jan 2023 09:41:54 +0000 (09:41 +0000)
src/Module/OStatus/PubSub.php
src/Module/OStatus/PubSubHubBub.php
src/Module/OStatus/Salmon.php
static/routes.config.php

index c83ac4986ba0721be2874f8ee039e4fb11584255..c4614855ca4107de53ad8405e36b8cab18410e5f 100644 (file)
@@ -58,6 +58,7 @@ class PubSub extends \Friendica\BaseModule
 
                $this->logger->info('Feed arrived.', ['from' =>  $this->request->getRemoteAddress(), 'for' => $this->args->getCommand(), 'user-agent' => $this->server['HTTP_USER_AGENT']]);
                $this->logger->debug('Data stream.', ['xml' => $xml]);
+               $this->logger->debug('Gut request data.', ['request' => $request]);
 
                $nickname   = $this->parameters['nickname'] ?? '';
                $contact_id = $this->parameters['cid']      ?? 0;
index edc2472f48c674322d15811173c798c2a2da1612..de2104b212e93c434912bd2bb46b3c8a6d52e024 100644 (file)
@@ -71,6 +71,8 @@ class PubSubHubBub extends \Friendica\BaseModule
                        throw new HTTPException\ForbiddenException();
                }
 
+               $this->logger->debug('Gut request data.', ['request' => $request]);
+
                // Subscription request from subscriber
                // https://pubsubhubbub.github.io/PubSubHubbub/pubsubhubbub-core-0.4.html#rfc.section.5.1
                // Example from GNU Social:
index 0fd901eaf470f8d912729949a691fc9a86c72433..64dcec22cff3ec6d775b10756436eb9edda9bdf0 100644 (file)
@@ -62,9 +62,10 @@ class Salmon extends \Friendica\BaseModule
         * @throws HTTPException\OKException
         * @throws \ImagickException
         */
-       protected function rawContent(array $request = [])
+       protected function post(array $request = [])
        {
                $xml = Network::postdata();
+               $this->logger->debug('Gut request data.', ['request' => $request]);
 
                $nickname = $this->parameters['nickname'] ?? '';
                if (empty($nickname)) {
index 1c6268aa952e2c3c303475c69eb3daa6338fcaa6..634b90b23abd947a6c289152daea846213af37ae 100644 (file)
@@ -598,12 +598,13 @@ return [
        ],
 
        // OStatus stack modules
-       '/ostatus/repair'              => [Module\OStatus\Repair::class,           [R::GET         ]],
-       '/ostatus/subscribe'           => [Module\OStatus\Subscribe::class,        [R::GET         ]],
-       '/poco'                        => [Module\User\PortableContacts::class,    [R::GET         ]],
-       '/pubsub/{nickname}/{cid:\d+}' => [Module\OStatus\PubSub::class,           [R::GET, R::POST]],
-       '/pubsubhubbub/{nickname}'     => [Module\OStatus\PubSubHubBub::class,     [        R::POST]],
-       '/salmon/{nickname}'           => [Module\OStatus\Salmon::class,           [        R::POST]],
+       '/ostatus/repair'                => [Module\OStatus\Repair::class,           [R::GET         ]],
+       '/ostatus/subscribe'             => [Module\OStatus\Subscribe::class,        [R::GET         ]],
+       '/poco'                          => [Module\User\PortableContacts::class,    [R::GET         ]],
+       '/pubsub'                        => [Module\OStatus\PubSub::class,           [R::GET, R::POST]],
+       '/pubsub/{nickname}[/{cid:\d+}]' => [Module\OStatus\PubSub::class,           [R::GET, R::POST]],
+       '/pubsubhubbub[/{nickname}]'     => [Module\OStatus\PubSubHubBub::class,     [        R::POST]],
+       '/salmon[/{nickname}]'           => [Module\OStatus\Salmon::class,           [        R::POST]],
 
        '/search' => [
                '[/]'                  => [Module\Search\Index::class, [R::GET         ]],