Add probe support to @user@domain.tld search string format

This commit is contained in:
Hypolite Petovan 2021-08-24 11:32:27 -04:00
parent 17944c01ea
commit 7a8d800024
3 changed files with 5 additions and 2 deletions

View file

@ -25,6 +25,7 @@ use Console_Table;
use Friendica\App;
use Friendica\Model\Contact as ContactModel;
use Friendica\Model\User as UserModel;
use Friendica\Network\Probe;
use Friendica\Util\Temporal;
use RuntimeException;
use Seld\CliPrompt\CliPrompt;
@ -153,6 +154,8 @@ HELP;
}
}
$url = Probe::cleanURI($url);
$contact = ContactModel::getByURLForUser($url, $user['uid']);
if (!empty($contact)) {
throw new RuntimeException('Contact already exists');