Don't store URL with hashtags / OStatus-Diaspora-Improvements

This commit is contained in:
Michael 2020-04-19 07:24:36 +00:00
parent ea60660c6d
commit 66f5e7c0f8
3 changed files with 5 additions and 1 deletions

View file

@ -94,7 +94,7 @@ class Tag
if (empty($cid)) { if (empty($cid)) {
$fields = ['name' => substr($name, 0, 96), 'url' => '']; $fields = ['name' => substr($name, 0, 96), 'url' => ''];
if (!empty($url) && ($url != $name)) { if (($type != Tag::HASHTAG) && !empty($url) && ($url != $name)) {
$fields['url'] = strtolower($url); $fields['url'] = strtolower($url);
} }

View file

@ -2781,6 +2781,8 @@ class Diaspora
$datarray["body"] = $prefix.$original_item["body"]."[/share]"; $datarray["body"] = $prefix.$original_item["body"]."[/share]";
Tag::storeFromBody($datarray['uri-id'], $datarray["body"]);
$datarray["tag"] = $original_item["tag"]; $datarray["tag"] = $original_item["tag"];
$datarray["attach"] = $original_item["attach"]; $datarray["attach"] = $original_item["attach"];
$datarray["app"] = $original_item["app"]; $datarray["app"] = $original_item["app"];

View file

@ -709,6 +709,8 @@ class OStatus
$item["body"] = add_page_info_to_body($item["body"]); $item["body"] = add_page_info_to_body($item["body"]);
} }
Tag::storeFromBody($item['uri-id'], $item['body']);
// Mastodon Content Warning // Mastodon Content Warning
if (($item["verb"] == Activity::POST) && $xpath->evaluate('boolean(atom:summary)', $entry)) { if (($item["verb"] == Activity::POST) && $xpath->evaluate('boolean(atom:summary)', $entry)) {
$clear_text = XML::getFirstNodeValue($xpath, 'atom:summary/text()', $entry); $clear_text = XML::getFirstNodeValue($xpath, 'atom:summary/text()', $entry);