<?php
/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
use Friendica\Network\HTTPException;
use Friendica\Network\Probe;
+use Friendica\Protocol\Delivery;
use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Map;
use Friendica\Util\Network;
use Friendica\Util\Strings;
use Friendica\Util\XML;
-use Friendica\Worker\Delivery;
use GuzzleHttp\Psr7\Uri;
use SimpleXMLElement;
}
if (!($fields = self::validPosting($msg))) {
- Logger::warning('Invalid posting', ['msg' => $msg]);
+ Logger::notice('Invalid posting', ['msg' => $msg]);
return false;
}
if (is_null($fields)) {
$private = true;
if (!($fields = self::validPosting($msg))) {
- Logger::warning('Invalid posting', ['msg' => $msg]);
+ Logger::notice('Invalid posting', ['msg' => $msg]);
return false;
}
} else {
*/
private static function contactByHandle(int $uid, WebFingerUri $uri): array
{
+ Contact::updateByUrlIfNeeded($uri->getAddr());
return Contact::getByURL($uri->getAddr(), null, [], $uid);
}
return 200;
}
+ if (!empty($contact['gsid']) && (empty($return_code) || $postResult->isTimeout())) {
+ GServer::setFailureById($contact['gsid']);
+ } elseif (!empty($contact['gsid']) && ($return_code >= 200) && ($return_code <= 299)) {
+ GServer::setReachableById($contact['gsid'], Protocol::DIASPORA);
+ }
+
Logger::notice('transmit: ' . $logid . '-' . $guid . ' to ' . $dest_url . ' returns: ' . $return_code);
return $return_code ? $return_code : -1;