From: Michael Date: Tue, 14 Apr 2020 17:00:56 +0000 (+0000) Subject: Corrections for DFRN, added support for OStatus X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1e702d41451ec7607a6d84885f4a3a9a5cba0c09;p=friendica.git Corrections for DFRN, added support for OStatus --- diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 8c7d42fbf4..a14513ab98 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -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)) { diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index bf3a6ef9d5..e155708aec 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -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]); } } }