X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fpubsubhubbub.php;h=4d33503796d0f2eaaa5374fc1742df968c40ba6e;hb=8487e0be175932dc0afc9cf05ee73049922a61ab;hp=d63a05d746a1968e07157f18d9ddc4e9f9c07405;hpb=b9dba631aadf6c25a97b679808c684276b3dd76a;p=friendica.git diff --git a/mod/pubsubhubbub.php b/mod/pubsubhubbub.php index d63a05d746..4d33503796 100644 --- a/mod/pubsubhubbub.php +++ b/mod/pubsubhubbub.php @@ -1,7 +1,25 @@ . + * + */ use Friendica\App; -use Friendica\Core\Config; use Friendica\Core\Logger; use Friendica\Database\DBA; use Friendica\DI; @@ -16,7 +34,7 @@ function post_var($name) { function pubsubhubbub_init(App $a) { // PuSH subscription must be considered "public" so just block it // if public access isn't enabled. - if (Config::get('system', 'block_public')) { + if (DI::config()->get('system', 'block_public')) { throw new \Friendica\Network\HTTPException\ForbiddenException(); } @@ -66,18 +84,12 @@ function pubsubhubbub_init(App $a) { // fetch user from database given the nickname $condition = ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false]; - $owner = DBA::selectFirst('user', ['uid', 'hidewall', 'nickname'], $condition); + $owner = DBA::selectFirst('user', ['uid', 'nickname'], $condition); if (!DBA::isResult($owner)) { Logger::log('Local account not found: ' . $nick . ' - topic: ' . $hub_topic . ' - callback: ' . $hub_callback); throw new \Friendica\Network\HTTPException\NotFoundException(); } - // abort if user's wall is supposed to be private - if ($owner['hidewall']) { - Logger::log('Local user ' . $nick . 'has chosen to hide wall, ignoring.'); - throw new \Friendica\Network\HTTPException\ForbiddenException(); - } - // get corresponding row from contact table $condition = ['uid' => $owner['uid'], 'blocked' => false, 'pending' => false, 'self' => true];