$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)) {
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;
$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);
}
$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]);
}
}
}