* Receives account migration
*
* @param array $importer Array of the importer user
- * @param object $data The message object
+ * @param SimpleXMLElement $data The message object
*
* @return bool Success
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
- private static function receiveAccountMigration(array $importer, $data): bool
+ private static function receiveAccountMigration(array $importer, SimpleXMLElement $data): bool
{
- // @TODO Need to find object type, roland@f.haeder.net
- Logger::debug('data=' . get_class($data));
$old_handle = XML::unescape($data->author);
$new_handle = XML::unescape($data->profile->author);
$signature = XML::unescape($data->signature);
/**
* Processes an account deletion
*
- * @param object $data The message object
+ * @param SimpleXMLElement $data The message object
*
* @return bool Success
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- private static function receiveAccountDeletion($data): bool
+ private static function receiveAccountDeletion(SimpleXMLElement $data): bool
{
- // @TODO Need to find object type, roland@f.haeder.net
- Logger::debug('data='.get_class($data));
$author = XML::unescape($data->author);
$contacts = DBA::select('contact', ['id'], ['addr' => $author]);
*
* @param array $importer Array of the importer user
* @param string $sender The sender of the message
- * @param object $data The message object
+ * @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 (self::PUSHED, self::FETCHED, self::FORCED_FETCH)
*
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
- private static function receiveComment(array $importer, string $sender, $data, string $xml, int $direction): bool
+ private static function receiveComment(array $importer, string $sender, SimpleXMLElement $data, string $xml, int $direction): bool
{
- // @TODO Need to find object type, roland@f.haeder.net
- Logger::debug('data='.get_class($data));
$author = XML::unescape($data->author);
$guid = XML::unescape($data->guid);
$parent_guid = XML::unescape($data->parent_guid);
*
* @param array $importer Array of the importer user
* @param array $contact The contact of the message
- * @param object $data The message object
+ * @param SimpleXMLElement $data The message object
* @param array $msg Array of the processed message, author handle and key
* @param object $mesg The private message
* @param array $conversation The conversation record to which this message belongs
*
* @return bool "true" if it was successful
* @throws \Exception
+ * @todo Find type-hint for $mesg and update documentation
*/
- private static function receiveConversationMessage(array $importer, array $contact, $data, array $msg, $mesg, array $conversation): bool
+ private static function receiveConversationMessage(array $importer, array $contact, SimpleXMLElement $data, array $msg, $mesg, array $conversation): bool
{
- // @TODO Need to find object type, roland@f.haeder.net
- Logger::debug('data='.get_class($data).',mesg='.get_class($mesg));
$author = XML::unescape($data->author);
$guid = XML::unescape($data->guid);
$subject = XML::unescape($data->subject);
*
* @param array $importer Array of the importer user
* @param array $msg Array of the processed message, author handle and key
- * @param object $data The message object
+ * @param SimpleXMLElement $data The message object
*
* @return bool Success
* @throws \Exception
*/
- private static function receiveConversation(array $importer, array $msg, $data)
+ private static function receiveConversation(array $importer, array $msg, SimpleXMLElement $data)
{
- // @TODO Need to find object type, roland@f.haeder.net
- Logger::debug('data='.get_class($data));
$author = XML::unescape($data->author);
$guid = XML::unescape($data->guid);
$subject = XML::unescape($data->subject);
*
* @param array $importer Array of the importer user
* @param string $sender The sender of the message
- * @param object $data The message object
+ * @param SimpleXMLElement $data The message object
* @param int $direction Indicates if the message had been fetched or pushed (self::PUSHED, self::FETCHED, self::FORCED_FETCH)
*
* @return bool Success or failure
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
- private static function receiveLike(array $importer, string $sender, $data, int $direction): bool
+ private static function receiveLike(array $importer, string $sender, SimpleXMLElement $data, int $direction): bool
{
- // @TODO Need to find object type, roland@f.haeder.net
- Logger::debug('data='.get_class($data));
$author = XML::unescape($data->author);
$guid = XML::unescape($data->guid);
$parent_guid = XML::unescape($data->parent_guid);
* Processes private messages
*
* @param array $importer Array of the importer user
- * @param object $data The message object
+ * @param SimpleXMLElement $data The message object
*
* @return bool Success?
* @throws \Exception
*/
- private static function receiveMessage(array $importer, $data): bool
+ private static function receiveMessage(array $importer, SimpleXMLElement $data): bool
{
- // @TODO Need to find object type, roland@f.haeder.net
- Logger::debug('data='.get_class($data));
$author = XML::unescape($data->author);
$guid = XML::unescape($data->guid);
$conversation_guid = XML::unescape($data->conversation_guid);
* Processes participations - unsupported by now
*
* @param array $importer Array of the importer user
- * @param object $data The message object
+ * @param SimpleXMLElement $data The message object
* @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
* @throws \ImagickException
*/
- private static function receiveParticipation(array $importer, $data, int $direction): bool
+ private static function receiveParticipation(array $importer, SimpleXMLElement $data, int $direction): bool
{
- // @TODO Need to find object type, roland@f.haeder.net
- Logger::debug('data='.get_class($data));
$author = strtolower(XML::unescape($data->author));
$guid = XML::unescape($data->guid);
$parent_guid = XML::unescape($data->parent_guid);
* Processes photos - unneeded
*
* @param array $importer Array of the importer user
- * @param object $data The message object
+ * @param SimpleXMLElement $data The message object
*
* @return bool always true
*/
* Processes incoming profile updates
*
* @param array $importer Array of the importer user
- * @param object $data The message object
+ * @param SimpleXMLElement $data The message object
*
* @return bool Success
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
- private static function receiveProfile(array $importer, $data): bool
+ private static function receiveProfile(array $importer, SimpleXMLElement $data): bool
{
- // @TODO Need to find object type, roland@f.haeder.net
- Logger::debug('data='.get_class($data));
$author = strtolower(XML::unescape($data->author));
$contact = self::contactByHandle($importer['uid'], $author);
* Processes incoming sharing notification
*
* @param array $importer Array of the importer user
- * @param object $data The message object
+ * @param SimpleXMLElement $data The message object
*
* @return bool Success
* @throws \Exception
*/
- private static function receiveContactRequest(array $importer, $data): bool
+ private static function receiveContactRequest(array $importer, SimpleXMLElement $data): bool
{
- // @TODO Need to find object type, roland@f.haeder.net
- Logger::debug('data='.get_class($data));
$author = XML::unescape($data->author);
$recipient = XML::unescape($data->recipient);
* Processes a reshare message
*
* @param array $importer Array of the importer user
- * @param object $data The message object
+ * @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 (self::PUSHED, self::FETCHED, self::FORCED_FETCH)
*
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
- private static function receiveReshare(array $importer, $data, string $xml, int $direction): bool
+ private static function receiveReshare(array $importer, SimpleXMLElement $data, string $xml, int $direction): bool
{
- // @TODO Need to find object type, roland@f.haeder.net
- Logger::debug('data='.get_class($data));
$author = XML::unescape($data->author);
$guid = XML::unescape($data->guid);
$created_at = DateTimeFormat::utc(XML::unescape($data->created_at));
*
* @param array $importer Array of the importer user
* @param array $contact The contact of the item owner
- * @param object $data The message object
+ * @param SimpleXMLElement $data The message object
*
* @return bool success
* @throws \Exception
*/
- private static function itemRetraction(array $importer, array $contact, $data): bool
+ private static function itemRetraction(array $importer, array $contact, SimpleXMLElement $data): bool
{
- // @TODO Need to find object type, roland@f.haeder.net
- Logger::debug('data='.get_class($data));
$author = XML::unescape($data->author);
$target_guid = XML::unescape($data->target_guid);
$target_type = XML::unescape($data->target_type);
*
* @param array $importer Array of the importer user
* @param string $sender The sender of the message
- * @param object $data The message object
+ * @param SimpleXMLElement $data The message object
*
* @return bool Success
* @throws \Exception
*/
- private static function receiveRetraction(array $importer, string $sender, $data)
+ private static function receiveRetraction(array $importer, string $sender, SimpleXMLElement $data)
{
- // @TODO Need to find object type, roland@f.haeder.net
- Logger::debug('data='.get_class($data));
$target_type = XML::unescape($data->target_type);
$contact = self::contactByHandle($importer['uid'], $sender);