]> git.mxchange.org Git - friendica.git/commitdiff
Use the new function when adding additional tags
authorMichael <heluecht@pirati.ca>
Fri, 17 Apr 2020 13:34:29 +0000 (13:34 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 17 Apr 2020 13:34:29 +0000 (13:34 +0000)
src/Protocol/ActivityPub/Processor.php
src/Protocol/DFRN.php

index 1b605c30abb135e785dbcbf51e6e20b256d27edb..b770e8a0de5713d2b9fef371ba2496ee93463340 100644 (file)
@@ -251,7 +251,7 @@ class Processor
                }
 
                foreach ($activity['receiver'] as $receiver) {
-                       $item = Item::selectFirst(['id', 'tag', 'origin', 'author-link'], ['uri' => $activity['target_id'], 'uid' => $receiver]);
+                       $item = Item::selectFirst(['id', 'uri-id', 'tag', 'origin', 'author-link'], ['uri' => $activity['target_id'], 'uid' => $receiver]);
                        if (!DBA::isResult($item)) {
                                // We don't fetch missing content for this purpose
                                continue;
@@ -262,6 +262,8 @@ class Processor
                                continue;
                        }
 
+                       Tag::store($item['uri-id'], Tag::HASHTAG, $activity['object_content'], $activity['object_id']);
+
                        // To-Do:
                        // - Check if "blocktag" is set
                        // - Check if actor is a contact
index 32067613f117527dc0e0349df3ed9e41d2c28115..8033ffb701622b89b9c5cbed49e63837616974cd 100644 (file)
@@ -2243,7 +2243,7 @@ class DFRN
                                $xt = XML::parseString($item["target"], false);
 
                                if ($xt->type == Activity\ObjectType::NOTE) {
-                                       $item_tag = Item::selectFirst(['id', 'tag'], ['uri' => $xt->id, 'uid' => $importer["importer_uid"]]);
+                                       $item_tag = Item::selectFirst(['id', 'uri-id', 'tag'], ['uri' => $xt->id, 'uid' => $importer["importer_uid"]]);
 
                                        if (!DBA::isResult($item_tag)) {
                                                Logger::log("Query failed to execute, no result returned in " . __FUNCTION__);
@@ -2252,6 +2252,8 @@ class DFRN
 
                                        // extract tag, if not duplicate, add to parent item
                                        if ($xo->content) {
+                                               Tag::store($item_tag['uri-id'], Tag::HASHTAG, $xo->content);
+
                                                if (!stristr($item_tag["tag"], trim($xo->content))) {
                                                        $tag = $item_tag["tag"] . (strlen($item_tag["tag"]) ? ',' : '') . '#[url=' . $xo->id . ']'. $xo->content . '[/url]';
                                                        Item::update(['tag' => $tag], ['id' => $item_tag["id"]]);