From: Michael Date: Sun, 19 Apr 2020 07:24:36 +0000 (+0000) Subject: Don't store URL with hashtags / OStatus-Diaspora-Improvements X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=66f5e7c0f883b08d6c8dd7fef4f95259ca874939;p=friendica.git Don't store URL with hashtags / OStatus-Diaspora-Improvements --- diff --git a/src/Model/Tag.php b/src/Model/Tag.php index f11286e6a3..bd1945c480 100644 --- a/src/Model/Tag.php +++ b/src/Model/Tag.php @@ -94,7 +94,7 @@ class Tag if (empty($cid)) { $fields = ['name' => substr($name, 0, 96), 'url' => '']; - if (!empty($url) && ($url != $name)) { + if (($type != Tag::HASHTAG) && !empty($url) && ($url != $name)) { $fields['url'] = strtolower($url); } diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index a8ffcbcfe5..d7e8f60a2e 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -2781,6 +2781,8 @@ class Diaspora $datarray["body"] = $prefix.$original_item["body"]."[/share]"; + Tag::storeFromBody($datarray['uri-id'], $datarray["body"]); + $datarray["tag"] = $original_item["tag"]; $datarray["attach"] = $original_item["attach"]; $datarray["app"] = $original_item["app"]; diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index d95810e3a6..ccec6d9348 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -709,6 +709,8 @@ class OStatus $item["body"] = add_page_info_to_body($item["body"]); } + Tag::storeFromBody($item['uri-id'], $item['body']); + // Mastodon Content Warning if (($item["verb"] == Activity::POST) && $xpath->evaluate('boolean(atom:summary)', $entry)) { $clear_text = XML::getFirstNodeValue($xpath, 'atom:summary/text()', $entry);