X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fpubsubhubbub.php;h=8689ae373cf5d3e8ef8be5db13b730e26100fa76;hb=660a3cd2471c1cb3ee1e505608124125cbc3b620;hp=3d6b48fd4bcc7a037d3610dec10c07435a6dc711;hpb=2ec3a97393959e42d450e074271d2d622d25701f;p=friendica.git diff --git a/mod/pubsubhubbub.php b/mod/pubsubhubbub.php index 3d6b48fd4b..8689ae373c 100644 --- a/mod/pubsubhubbub.php +++ b/mod/pubsubhubbub.php @@ -1,6 +1,6 @@ argc > 1) { + if (DI::args()->getArgc() > 1) { // Normally the url should now contain the nick name as last part of the url - $nick = $a->argv[1]; + $nick = DI::args()->getArgv()[1]; } else { // Get the nick name from the topic as a fallback $nick = $hub_topic; @@ -84,18 +83,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]; @@ -132,7 +125,7 @@ function pubsubhubbub_init(App $a) { $hub_callback = rtrim($hub_callback, ' ?&#'); $separator = parse_url($hub_callback, PHP_URL_QUERY) === null ? '?' : '&'; - $fetchResult = Network::fetchUrlFull($hub_callback . $separator . $params); + $fetchResult = DI::httpRequest()->fetchFull($hub_callback . $separator . $params); $body = $fetchResult->getBody(); $ret = $fetchResult->getReturnCode();