mirror of
https://github.com/friendica/friendica
synced 2024-11-13 12:22:53 +00:00
Merge remote-tracking branch 'upstream/develop' into term2tag
This commit is contained in:
commit
f52614e249
3 changed files with 16 additions and 30 deletions
|
@ -342,10 +342,6 @@ class Item
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists('interaction', $row)) {
|
|
||||||
$row['signed_text'] = $row['interaction'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (array_key_exists('ignored', $row) && array_key_exists('internal-user-ignored', $row) && !is_null($row['internal-user-ignored'])) {
|
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'];
|
$row['ignored'] = $row['internal-user-ignored'];
|
||||||
}
|
}
|
||||||
|
@ -715,7 +711,7 @@ class Item
|
||||||
'nofinish' => 'event-nofinish','adjust' => 'event-adjust',
|
'nofinish' => 'event-nofinish','adjust' => 'event-adjust',
|
||||||
'ignore' => 'event-ignore', 'id' => 'event-id'];
|
'ignore' => 'event-ignore', 'id' => 'event-id'];
|
||||||
|
|
||||||
$fields['diaspora-interaction'] = ['interaction'];
|
$fields['diaspora-interaction'] = ['interaction', 'interaction' => 'signed_text'];
|
||||||
|
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
@ -853,10 +849,6 @@ class Item
|
||||||
$selected[] = 'internal-user-ignored';
|
$selected[] = 'internal-user-ignored';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('signed_text', $selected)) {
|
|
||||||
$selected[] = 'interaction';
|
|
||||||
}
|
|
||||||
|
|
||||||
$legacy_fields = array_merge(ItemDeliveryData::LEGACY_FIELD_LIST, self::MIXED_CONTENT_FIELDLIST);
|
$legacy_fields = array_merge(ItemDeliveryData::LEGACY_FIELD_LIST, self::MIXED_CONTENT_FIELDLIST);
|
||||||
|
|
||||||
$selection = [];
|
$selection = [];
|
||||||
|
|
|
@ -1070,7 +1070,7 @@ class DFRN
|
||||||
// The signed text contains the content in Markdown, the sender handle and the signatur for the content
|
// 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.
|
// It is needed for relayed comments to Diaspora.
|
||||||
if ($item['signed_text']) {
|
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);
|
XML::addElement($doc, $entry, "dfrn:diaspora_signature", $sign);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4016,30 +4016,24 @@ class Diaspora
|
||||||
|
|
||||||
Logger::log("Got relayable data ".$type." for item ".$item["guid"]." (".$item["id"].")", Logger::DEBUG);
|
Logger::log("Got relayable data ".$type." for item ".$item["guid"]." (".$item["id"].")", Logger::DEBUG);
|
||||||
|
|
||||||
// Old way - is used by the internal Friendica functions
|
$msg = json_decode($item['signed_text'], true);
|
||||||
/// @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 = [];
|
$message = [];
|
||||||
if (is_array($msg)) {
|
if (is_array($msg)) {
|
||||||
foreach ($msg as $field => $data) {
|
foreach ($msg as $field => $data) {
|
||||||
if (!$item["deleted"]) {
|
if (!$item["deleted"]) {
|
||||||
if ($field == "diaspora_handle") {
|
if ($field == "diaspora_handle") {
|
||||||
$field = "author";
|
$field = "author";
|
||||||
}
|
}
|
||||||
if ($field == "target_type") {
|
if ($field == "target_type") {
|
||||||
$field = "parent_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);
|
$message["parent_author_signature"] = self::signature($owner, $message);
|
||||||
|
|
Loading…
Reference in a new issue