diff --git a/src/Model/Item.php b/src/Model/Item.php index b9c01809fd..d24340d764 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -342,10 +342,6 @@ class Item } } - if (array_key_exists('signed_text', $row) && array_key_exists('interaction', $row) && !is_null($row['interaction'])) { - $row['signed_text'] = $row['interaction']; - } - if (array_key_exists('ignored', $row) && array_key_exists('internal-user-ignored', $row) && !is_null($row['internal-user-ignored'])) { $row['ignored'] = $row['internal-user-ignored']; } @@ -672,7 +668,8 @@ class Item { $fields = []; - $fields['item'] = ['id', 'uid', 'parent', 'uri', 'parent-uri', 'thr-parent', 'guid', + $fields['item'] = ['id', 'uid', 'parent', 'uri', 'parent-uri', 'thr-parent', + 'guid', 'uri-id', 'parent-uri-id', 'thr-parent-id', 'contact-id', 'owner-id', 'author-id', 'type', 'wall', 'gravity', 'extid', 'created', 'edited', 'commented', 'received', 'changed', 'psid', 'resource-id', 'event-id', 'tag', 'attach', 'post-type', 'file', @@ -714,7 +711,7 @@ class Item 'nofinish' => 'event-nofinish','adjust' => 'event-adjust', 'ignore' => 'event-ignore', 'id' => 'event-id']; - $fields['diaspora-interaction'] = ['interaction']; + $fields['diaspora-interaction'] = ['interaction', 'interaction' => 'signed_text']; return $fields; } @@ -852,10 +849,6 @@ class Item $selected[] = 'internal-user-ignored'; } - if (in_array('signed_text', $selected)) { - $selected[] = 'interaction'; - } - $legacy_fields = array_merge(ItemDeliveryData::LEGACY_FIELD_LIST, self::MIXED_CONTENT_FIELDLIST); $selection = []; diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 4c71de4d57..cbd7574158 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -1072,7 +1072,7 @@ class DFRN // The signed text contains the content in Markdown, the sender handle and the signatur for the content // It is needed for relayed comments to Diaspora. if ($item['signed_text']) { - $sign = base64_encode(json_encode(['signed_text' => $item['signed_text'],'signature' => $item['signature'],'signer' => $item['signer']])); + $sign = base64_encode(json_encode(['signed_text' => $item['signed_text'],'signature' => '','signer' => ''])); XML::addElement($doc, $entry, "dfrn:diaspora_signature", $sign); } 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); + $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 = []; + 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);