From: Michael Date: Wed, 15 Apr 2020 05:51:06 +0000 (+0000) Subject: The old fields don't exist anymore X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=fe48b078e413ea3c5e89bc0e8d24fe9cead7469c;p=friendica.git The old fields don't exist anymore --- diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 828333b41f..4827a06510 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -3941,30 +3941,24 @@ class Diaspora Logger::log("Got relayable data ".$type." for item ".$item["guid"]." (".$item["id"].")", Logger::DEBUG); - // Old way - is used by the internal Friendica functions - /// @todo Change all signatur storing functions to the new format - if ($item['signed_text'] && $item['signature'] && $item['signer']) { - $message = self::messageFromSignature($item); - } else {// New way - $msg = json_decode($item['signed_text'], true); - - $message = []; - if (is_array($msg)) { - foreach ($msg as $field => $data) { - if (!$item["deleted"]) { - if ($field == "diaspora_handle") { - $field = "author"; - } - if ($field == "target_type") { - $field = "parent_type"; - } + $msg = json_decode($item['signed_text'], true); + + $message = []; + if (is_array($msg)) { + foreach ($msg as $field => $data) { + if (!$item["deleted"]) { + if ($field == "diaspora_handle") { + $field = "author"; + } + if ($field == "target_type") { + $field = "parent_type"; } - - $message[$field] = $data; } - } else { - Logger::log("Signature text for item ".$item["guid"]." (".$item["id"].") couldn't be extracted: ".$item['signed_text'], Logger::DEBUG); + + $message[$field] = $data; } + } else { + Logger::log("Signature text for item ".$item["guid"]." (".$item["id"].") couldn't be extracted: ".$item['signed_text'], Logger::DEBUG); } $message["parent_author_signature"] = self::signature($owner, $message);