X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsalmon.php;h=e9ab311c993eb01f3c843f7407e886ced8700e3a;hb=7cdd2d1336e768def2f9b2dc1d4026f8d9bb3804;hp=1e92980f1ceb123a2ef362e97581fc780be7e816;hpb=2a431b580f2e8f6a596e84175932e793678cde63;p=friendica.git diff --git a/mod/salmon.php b/mod/salmon.php index 1e92980f1c..e9ab311c99 100644 --- a/mod/salmon.php +++ b/mod/salmon.php @@ -42,7 +42,7 @@ function salmon_post(App $a, $xml = '') { Logger::log('new salmon ' . $xml, Logger::DATA); - $nick = (($a->argc > 1) ? Strings::escapeTags(trim($a->argv[1])) : ''); + $nick = ((DI::args()->getArgc() > 1) ? Strings::escapeTags(trim(DI::args()->getArgv()[1])) : ''); $importer = DBA::selectFirst('user', [], ['nickname' => $nick, 'account_expired' => false, 'account_removed' => false]); if (! DBA::isResult($importer)) { @@ -169,24 +169,6 @@ function salmon_post(App $a, $xml = '') { intval($importer['uid']) ); - if (!DBA::isResult($r)) { - Logger::log('Author ' . $author_link . ' unknown to user ' . $importer['uid'] . '.'); - - if (DI::pConfig()->get($importer['uid'], 'system', 'ostatus_autofriend')) { - $result = Contact::createFromProbe($importer, $author_link); - - if ($result['success']) { - $r = q("SELECT * FROM `contact` WHERE `network` = '%s' AND ( `url` = '%s' OR `alias` = '%s') - AND `uid` = %d LIMIT 1", - DBA::escape(Protocol::OSTATUS), - DBA::escape($author_link), - DBA::escape($author_link), - intval($importer['uid']) - ); - } - } - } - if (!empty($r[0]['gsid'])) { GServer::setProtocol($r[0]['gsid'], Post\DeliveryData::OSTATUS); } @@ -194,7 +176,6 @@ function salmon_post(App $a, $xml = '') { // Have we ignored the person? // If so we can not accept this post. - //if((DBA::isResult($r)) && (($r[0]['readonly']) || ($r[0]['rel'] == Contact::FOLLOWER) || ($r[0]['blocked']))) { if (DBA::isResult($r) && $r[0]['blocked']) { Logger::log('Ignoring this author.'); throw new \Friendica\Network\HTTPException\AcceptedException();