$url = $apcontact['url'];
}
+ // Detect multiple fast repeating request to the same address
+ // See https://github.com/friendica/friendica/issues/9303
+ $cachekey = 'apcontact:getByURL:' . $url;
+ $result = DI::cache()->get($cachekey);
+ if (!is_null($result)) {
+ Logger::notice('Multiple requests for the address', ['url' => $url, 'update' => $update, 'callstack' => System::callstack(20), 'result' => $result]);
+ if (!empty($fetched_contact)) {
+ return $fetched_contact;
+ }
+ } else {
+ DI::cache()->set($cachekey, System::callstack(20), Duration::FIVE_MINUTES);
+ }
+
$curlResult = HTTPSignature::fetchRaw($url);
$failed = empty($curlResult) || empty($curlResult->getBody()) ||
(!$curlResult->isSuccess() && ($curlResult->getReturnCode() != 410));
return $fetched_contact;
}
- // Detect multiple fast repeating request to the same address
- // See https://github.com/friendica/friendica/issues/9303
- $cachekey = 'apcontact:getByURL:' . $url;
- $result = DI::cache()->get($cachekey);
- if (!is_null($result)) {
- Logger::notice('Multiple requests for the address', ['url' => $url, 'update' => $update, 'callstack' => System::callstack(20), 'result' => $result]);
- } else {
- DI::cache()->set($cachekey, System::callstack(20), Duration::FIVE_MINUTES);
- }
-
$apcontact['url'] = $compacted['@id'];
$apcontact['uuid'] = JsonLD::fetchElement($compacted, 'diaspora:guid', '@value');
$apcontact['type'] = str_replace('as:', '', JsonLD::fetchElement($compacted, '@type'));
*/
public static function getOutbox($owner, $page = null, $requester = '')
{
- $public_contact = Contact::getIdForURL($owner['url']);
+ $public_contact = Contact::getIdForURL($owner['url'], 0, false);
$condition = ['uid' => 0, 'contact-id' => $public_contact,
'private' => [Item::PUBLIC, Item::UNLISTED]];