]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Feed.php
Code standards
[friendica.git] / src / Protocol / Feed.php
index 0ce4144387027e22b5a5f8b39c3ade123fcad413..14a3c28ab9b002dd1446841dd848a376c4715cdb 100644 (file)
@@ -29,7 +29,7 @@ use Friendica\Core\Protocol;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\Item;
-use Friendica\Model\Term;
+use Friendica\Model\Tag;
 use Friendica\Util\Network;
 use Friendica\Util\ParseUrl;
 use Friendica\Util\XML;
@@ -478,7 +478,7 @@ class Feed {
                                $item["title"] = "";
                                $item["body"] = $item["body"] . add_page_info($item["plink"], false, $preview, ($contact["fetch_further_information"] == 2), $contact["ffi_keyword_blacklist"]);
                                $item["tag"] = add_page_keywords($item["plink"], $preview, ($contact["fetch_further_information"] == 2), $contact["ffi_keyword_blacklist"]);
-                               $taglist = add_page_keywords($item["plink"], $preview, ($contact["fetch_further_information"] == 2), $contact["ffi_keyword_blacklist"], true);
+                               $taglist = get_page_keywords($item["plink"], $preview, ($contact["fetch_further_information"] == 2), $contact["ffi_keyword_blacklist"]);
                                $item["object-type"] = Activity\ObjectType::BOOKMARK;
                                unset($item["attach"]);
                        } else {
@@ -492,7 +492,7 @@ class Feed {
                                        } else {
                                                // @todo $preview is never set in this case, is it intended? - @MrPetovan 2018-02-13
                                                $item["tag"] = add_page_keywords($item["plink"], $preview, true, $contact["ffi_keyword_blacklist"]);
-                                               $taglist = add_page_keywords($item["plink"], $preview, true, $contact["ffi_keyword_blacklist"], true);
+                                               $taglist = get_page_keywords($item["plink"], $preview, true, $contact["ffi_keyword_blacklist"]);
                                        }
                                        $item["body"] .= "\n" . $item['tag'];
                                } else {
@@ -523,7 +523,7 @@ class Feed {
                                        // Set the delivery priority for "remote self" to "medium"
                                        $notify = PRIORITY_MEDIUM;
                                }
-       
+
                                $id = Item::insert($item, false, $notify);
 
                                Logger::info("Feed for contact " . $contact["url"] . " stored under id " . $id);
@@ -531,10 +531,7 @@ class Feed {
                                if (!empty($id) && !empty($taglist)) {
                                        $feeditem = Item::selectFirst(['uri-id'], ['id' => $id]);
                                        foreach ($taglist as $tag) {
-                                               $fields = ['uri-id' => $feeditem['uri-id'], 'name' => substr($tag, 0, 64), 'type' => Term::HASHTAG];
-                                               DBA::insert('tag', $fields, true);
-               
-                                               Logger::info('Stored tag', ['uri-id' => $feeditem['uri-id'], 'tag' => $tag, 'fields' => $fields]);
+                                               Tag::store($feeditem['uri-id'], Tag::HASHTAG, $tag);
                                        }                                       
                                }
                        }