mirror of
https://github.com/friendica/friendica
synced 2025-04-27 23:10:12 +00:00
Remove dependency to App in Contact::createFromProbe
- Address https://github.com/friendica/friendica/issues/8473#issuecomment-641259906
This commit is contained in:
parent
5f18d27b0b
commit
a5a7855d39
7 changed files with 32 additions and 33 deletions
|
@ -23,6 +23,7 @@ namespace Friendica\Worker;
|
|||
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\User;
|
||||
|
||||
class AddContact
|
||||
{
|
||||
|
@ -33,7 +34,11 @@ class AddContact
|
|||
*/
|
||||
public static function execute(int $uid, string $url)
|
||||
{
|
||||
$result = Contact::createFromProbe($uid, $url, '', false);
|
||||
$user = User::getById($uid);
|
||||
if (empty($user)) {
|
||||
return;
|
||||
}
|
||||
$result = Contact::createFromProbe($user, $url, '', false);
|
||||
Logger::info('Added contact', ['uid' => $uid, 'url' => $url, 'result' => $result]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue