use Friendica\Model\Post;
use Friendica\Model\Tag;
use Friendica\Model\User;
+use Friendica\Network\HTTPClient\Client\HttpClient;
use Friendica\Network\Probe;
use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;
* Dispatches public messages and find the fitting receivers
*
* @param array $msg The post that will be dispatched
- * @param int $direction Indicates if the message had been fetched or pushed
+ * @param int $direction Indicates if the message had been fetched or pushed (self::PUSHED, self::FETCHED, self::FORCED_FETCH)
*
* @return int The message id of the generated message, "true" or "false" if there was an error
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @param array $importer Array of the importer user
* @param array $msg The post that will be dispatched
* @param SimpleXMLElement $fields SimpleXML object that contains the message
- * @param int $direction Indicates if the message had been fetched or pushed
+ * @param int $direction Indicates if the message had been fetched or pushed (self::PUSHED, self::FETCHED, self::FORCED_FETCH)
*
* @return int The message id of the generated message, "true" or "false" if there was an error
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
Logger::info("Fetch post from ".$source_url);
- $envelope = DI::httpClient()->fetch($source_url);
+ $envelope = DI::httpClient()->fetch($source_url, 0, HttpClient::ACCEPT_MAGIC);
if ($envelope) {
Logger::info("Envelope was fetched.");
$x = self::verifyMagicEnvelope($envelope);
* @param string $sender The sender of the message
* @param object $data The message object
* @param string $xml The original XML of the message
- * @param int $direction Indicates if the message had been fetched or pushed
+ * @param int $direction Indicates if the message had been fetched or pushed (self::PUSHED, self::FETCHED, self::FORCED_FETCH)
*
* @return int The message id of the generated comment or "false" if there was an error
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @param array $importer Array of the importer user
* @param string $sender The sender of the message
* @param object $data The message object
- * @param int $direction Indicates if the message had been fetched or pushed
+ * @param int $direction Indicates if the message had been fetched or pushed (self::PUSHED, self::FETCHED, self::FORCED_FETCH)
*
* @return int The message id of the generated like or "false" if there was an error
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*
* @param array $importer Array of the importer user
* @param object $data The message object
- * @param int $direction Indicates if the message had been fetched or pushed
+ * @param int $direction Indicates if the message had been fetched or pushed (self::PUSHED, self::FETCHED, self::FORCED_FETCH)
*
* @return bool success
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @param array $importer Array of the importer user
* @param object $data The message object
* @param string $xml The original XML of the message
- * @param int $direction Indicates if the message had been fetched or pushed
+ * @param int $direction Indicates if the message had been fetched or pushed (self::PUSHED, self::FETCHED, self::FORCED_FETCH)
*
* @return int the message id
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @param array $item
* @param string $author
* @param string $body
- * @param int $direction Indicates if the message had been fetched or pushed
+ * @param int $direction Indicates if the message had been fetched or pushed (self::PUSHED, self::FETCHED, self::FORCED_FETCH)
*
* @return boolean Is the message wanted?
*/
* @param array $importer Array of the importer user
* @param SimpleXMLElement $data The message object
* @param string $xml The original XML of the message
- * @param int $direction Indicates if the message had been fetched or pushed
+ * @param int $direction Indicates if the message had been fetched or pushed (self::PUSHED, self::FETCHED, self::FORCED_FETCH)
*
* @return int The message id of the newly created item
* @throws \Friendica\Network\HTTPException\InternalServerErrorException