]> git.mxchange.org Git - friendica.git/commitdiff
Corrections for DFRN, added support for OStatus
authorMichael <heluecht@pirati.ca>
Tue, 14 Apr 2020 17:00:56 +0000 (17:00 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 14 Apr 2020 17:00:56 +0000 (17:00 +0000)
src/Protocol/DFRN.php
src/Protocol/OStatus.php

index 8c7d42fbf44f13b208a106168d17f6064119bfbc..a14513ab9819314d6235a81d3ed53dca376a6062 100644 (file)
@@ -2465,13 +2465,13 @@ class DFRN
                                                $fields = ['uri-id' => $item['uri-id'], 'name' => substr($term, 0, 64)];
 
                                                if ($termhash == Term::TAG_CHARACTER[Term::MENTION]) {
-                                                       $fields['type'] = Term::EXCLUSIVE_MENTION;
+                                                       $fields['type'] = Term::MENTION;
                                                } elseif ($termhash == Term::TAG_CHARACTER[Term::EXCLUSIVE_MENTION]) {
                                                        $fields['type'] = Term::EXCLUSIVE_MENTION;
                                                } elseif ($termhash == Term::TAG_CHARACTER[Term::IMPLICIT_MENTION]) {
                                                        $fields['type'] = Term::IMPLICIT_MENTION;
                                                } elseif ($termhash == Term::TAG_CHARACTER[Term::HASHTAG]) {
-                                                       $fields['type'] = Term::IMPLICIT_MENTION;
+                                                       $fields['type'] = Term::HASHTAG;
                                                }
 
                                                if (!empty($termurl)) {
index bf3a6ef9d597021227c21bd57b6096dbd592c842..e155708aece7d6231d276ea6fc1d93078df98947 100644 (file)
@@ -35,6 +35,8 @@ use Friendica\Model\Contact;
 use Friendica\Model\Conversation;
 use Friendica\Model\GContact;
 use Friendica\Model\Item;
+use Friendica\Model\ItemURI;
+use Friendica\Model\Term;
 use Friendica\Model\User;
 use Friendica\Network\Probe;
 use Friendica\Util\DateTimeFormat;
@@ -437,6 +439,7 @@ class OStatus
                        $item = array_merge($header, $author);
 
                        $item["uri"] = XML::getFirstNodeValue($xpath, 'atom:id/text()', $entry);
+                       $item['uri-id'] = ItemURI::insert(['uri' => $item['uri']]);
 
                        $item["verb"] = XML::getFirstNodeValue($xpath, 'activity:verb/text()', $entry);
 
@@ -660,6 +663,12 @@ class OStatus
                                                }
 
                                                $item['tag'] .= '#[url=' . DI::baseUrl() . '/search?tag=' . $term . ']' . $term . '[/url]';
+
+                                               // Store the hashtag
+                                               $fields = ['uri-id' => $item['uri-id'], 'name' => substr($term, 0, 64), 'type' => Term::HASHTAG];
+                                               DBA::insert('tag', $fields, true);
+
+                                               Logger::info('Stored tag', ['uri-id' => $item['uri-id'], 'tag' => $term, 'fields' => $fields]);
                                        }
                                }
                        }