mirror of
https://github.com/friendica/friendica
synced 2025-04-28 02:30:16 +00:00
The item view is completed, unneeded fields removed
This commit is contained in:
parent
122ad0af14
commit
ca16a4892b
3 changed files with 125 additions and 125 deletions
|
@ -3700,51 +3700,6 @@ class Diaspora
|
|||
return self::buildAndTransmit($owner, $contact, $type, $message, $public_batch, $item["guid"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a message from a signature record entry
|
||||
*
|
||||
* @param array $item The item that will be exported
|
||||
* @return array The message
|
||||
*/
|
||||
private static function messageFromSignature(array $item)
|
||||
{
|
||||
// Split the signed text
|
||||
$signed_parts = explode(";", $item['signed_text']);
|
||||
|
||||
if ($item["deleted"]) {
|
||||
$message = ["author" => $item['signer'],
|
||||
"target_guid" => $signed_parts[0],
|
||||
"target_type" => $signed_parts[1]];
|
||||
} elseif (in_array($item["verb"], [Activity::LIKE, Activity::DISLIKE])) {
|
||||
$message = ["author" => $signed_parts[4],
|
||||
"guid" => $signed_parts[1],
|
||||
"parent_guid" => $signed_parts[3],
|
||||
"parent_type" => $signed_parts[2],
|
||||
"positive" => $signed_parts[0],
|
||||
"author_signature" => $item['signature'],
|
||||
"parent_author_signature" => ""];
|
||||
} else {
|
||||
// Remove the comment guid
|
||||
$guid = array_shift($signed_parts);
|
||||
|
||||
// Remove the parent guid
|
||||
$parent_guid = array_shift($signed_parts);
|
||||
|
||||
// Remove the handle
|
||||
$handle = array_pop($signed_parts);
|
||||
|
||||
$message = [
|
||||
"author" => $handle,
|
||||
"guid" => $guid,
|
||||
"parent_guid" => $parent_guid,
|
||||
"text" => implode(";", $signed_parts),
|
||||
"author_signature" => $item['signature'],
|
||||
"parent_author_signature" => ""
|
||||
];
|
||||
}
|
||||
return $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Relays messages (like, comment, retraction) to other servers if we are the thread owner
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue