Corrections for DFRN, added support for OStatus

This commit is contained in:
Michael 2020-04-14 17:00:56 +00:00
parent 3f4c85dead
commit 1e702d4145
2 changed files with 11 additions and 2 deletions

View 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)) {

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