]> git.mxchange.org Git - friendica.git/commitdiff
Don't store URL with hashtags / OStatus-Diaspora-Improvements
authorMichael <heluecht@pirati.ca>
Sun, 19 Apr 2020 07:24:36 +0000 (07:24 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 19 Apr 2020 07:24:36 +0000 (07:24 +0000)
src/Model/Tag.php
src/Protocol/Diaspora.php
src/Protocol/OStatus.php

index f11286e6a3aca3b49b853186db1f7fef99be093d..bd1945c4801dbc65908d3b0a75ebb453ff02af09 100644 (file)
@@ -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);
                        }
        
index a8ffcbcfe5456f62f379df99bc7fa9ad67ebab64..d7e8f60a2e5acb8567720648b7b3da7977bb3a3d 100644 (file)
@@ -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"];
index d95810e3a6dfcee21dee29a7e17e8d0c2db58420..ccec6d9348885acdcb53780a3c4f95e2da813ab7 100644 (file)
@@ -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);