use Friendica\Model\Profile;
use Friendica\Protocol\Email;
use Friendica\Protocol\Feed;
+use Friendica\Protocol\ActivityPub;
use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
$uid = local_user();
}
- $data = self::detect($uri, $network, $uid);
+ if ($network != Protocol::ACTIVITYPUB) {
+ $data = self::detect($uri, $network, $uid);
+ } else {
+ $data = null;
+ }
+
+ if (in_array(defaults($data, 'network', ''), ['', Protocol::PHANTOM])) {
+ $ap_profile = ActivityPub::fetchProfile($uri);
+ if (!empty($ap_profile) && ($ap_profile['network'] == Protocol::ACTIVITYPUB)) {
+ $data = $ap_profile;
+ }
+ }
if (!isset($data["url"])) {
$data["url"] = $uri;
$prof_data = [];
- if (empty($data["addr"])) {
+ if (empty($data["addr"]) || empty($data["nick"])) {
$probe_data = self::uri($profile_link);
- $data["addr"] = $probe_data["addr"];
+ $data["addr"] = defaults($data, "addr", $probe_data["addr"]);
+ $data["nick"] = defaults($data, "nick", $probe_data["nick"]);
}
$prof_data["addr"] = $data["addr"];