Some more invalid feed elements

This commit is contained in:
Michael 2020-07-11 19:11:35 +00:00
parent e5a336ff77
commit 0100e0df84

View file

@ -2095,6 +2095,7 @@ class OStatus
$mentioned[$tag['url']] = $tag['url']; $mentioned[$tag['url']] = $tag['url'];
} }
if (!$feed_mode) {
// Make sure that mentions are accepted (GNU Social has problems with mixing HTTP and HTTPS) // Make sure that mentions are accepted (GNU Social has problems with mixing HTTP and HTTPS)
$newmentions = []; $newmentions = [];
foreach ($mentioned as $mention) { foreach ($mentioned as $mention) {
@ -2130,7 +2131,7 @@ class OStatus
]); ]);
} }
if (($item['private'] != Item::PRIVATE) && !$feed_mode) { if ($item['private'] != Item::PRIVATE) {
XML::addElement($doc, $entry, "link", "", ["rel" => "ostatus:attention", XML::addElement($doc, $entry, "link", "", ["rel" => "ostatus:attention",
"href" => "http://activityschema.org/collection/public"]); "href" => "http://activityschema.org/collection/public"]);
XML::addElement($doc, $entry, "link", "", ["rel" => "mentioned", XML::addElement($doc, $entry, "link", "", ["rel" => "mentioned",
@ -2138,6 +2139,7 @@ class OStatus
"href" => "http://activityschema.org/collection/public"]); "href" => "http://activityschema.org/collection/public"]);
XML::addElement($doc, $entry, "mastodon:scope", "public"); XML::addElement($doc, $entry, "mastodon:scope", "public");
} }
}
foreach ($tags as $tag) { foreach ($tags as $tag) {
if ($tag['type'] == Tag::HASHTAG) { if ($tag['type'] == Tag::HASHTAG) {
@ -2147,7 +2149,7 @@ class OStatus
self::getAttachment($doc, $entry, $item); self::getAttachment($doc, $entry, $item);
if ($complete && ($item["id"] > 0)) { if (!$feed_mode && $complete && ($item["id"] > 0)) {
$app = $item["app"]; $app = $item["app"];
if ($app == "") { if ($app == "") {
$app = "web"; $app = "web";
@ -2163,11 +2165,9 @@ class OStatus
XML::addElement($doc, $entry, "georss:point", $item["coord"]); XML::addElement($doc, $entry, "georss:point", $item["coord"]);
} }
if (!$feed_mode) {
XML::addElement($doc, $entry, "statusnet:notice_info", "", $attributes); XML::addElement($doc, $entry, "statusnet:notice_info", "", $attributes);
} }
} }
}
/** /**
* Creates the XML feed for a given nickname * Creates the XML feed for a given nickname