X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fdfrn_confirm.php;h=acdf92281520281bd66be0009e89656f4e3aa26e;hb=6001c34525867a0aa614dbc020dcbc485e515345;hp=f8d2be44d6da35eb393204a719ea4253fd5248c6;hpb=0007da8630feed2f3207b95d226309a5f03ded43;p=friendica.git diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index f8d2be44d6..acdf922815 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -40,12 +40,12 @@ use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Group; +use Friendica\Model\Notify; use Friendica\Model\Notify\Type; use Friendica\Model\User; use Friendica\Protocol\Activity; use Friendica\Util\Crypto; use Friendica\Util\DateTimeFormat; -use Friendica\Util\Network; use Friendica\Util\Strings; use Friendica\Util\XML; @@ -224,7 +224,7 @@ function dfrn_confirm_post(App $a, $handsfree = null) * */ - $res = Network::post($dfrn_confirm, $params, [], 120)->getBody(); + $res = DI::httpRequest()->post($dfrn_confirm, $params, [], 120)->getBody(); Logger::log(' Confirm: received data: ' . $res, Logger::DATA); @@ -305,7 +305,7 @@ function dfrn_confirm_post(App $a, $handsfree = null) * * We will also update the contact record with the nature and scope of the relationship. */ - Contact::updateAvatar($contact['photo'], $uid, $contact_id); + Contact::updateAvatar($contact_id, $contact['photo']); Logger::log('dfrn_confirm: confirm - imported photos'); @@ -482,10 +482,10 @@ function dfrn_confirm_post(App $a, $handsfree = null) if (DBA::isResult($contact)) { $photo = $contact['photo']; } else { - $photo = DI::baseUrl() . '/images/person-300.jpg'; + $photo = DI::baseUrl() . Contact::DEFAULT_AVATAR_PHOTO; } - Contact::updateAvatar($photo, $local_uid, $dfrn_record); + Contact::updateAvatar($dfrn_record, $photo); Logger::log('dfrn_confirm: request - photos imported'); @@ -543,18 +543,12 @@ function dfrn_confirm_post(App $a, $handsfree = null) if ($combined['notify-flags'] & Type::CONFIRM) { $mutual = ($new_relation == Contact::FRIEND); notification([ - 'type' => Type::CONFIRM, - 'notify_flags' => $combined['notify-flags'], - 'language' => $combined['language'], - 'to_name' => $combined['username'], - 'to_email' => $combined['email'], - 'uid' => $combined['uid'], - 'link' => DI::baseUrl() . '/contact/' . $dfrn_record, - 'source_name' => ((strlen(stripslashes($combined['name']))) ? stripslashes($combined['name']) : DI::l10n()->t('[Name Withheld]')), - 'source_link' => $combined['url'], - 'source_photo' => $combined['photo'], - 'verb' => ($mutual ? Activity::FRIEND : Activity::FOLLOW), - 'otype' => 'intro' + 'type' => Type::CONFIRM, + 'otype' => Notify\ObjectType::INTRO, + 'verb' => ($mutual ? Activity::FRIEND : Activity::FOLLOW), + 'uid' => $combined['uid'], + 'cid' => $combined['id'], + 'link' => DI::baseUrl() . '/contact/' . $dfrn_record, ]); } }