use Friendica\Model\Event;
use Friendica\Model\GContact;
use Friendica\Model\Item;
+use Friendica\Model\ItemURI;
use Friendica\Model\Mail;
use Friendica\Model\Notify\Type;
use Friendica\Model\PermissionSet;
// The signed text contains the content in Markdown, the sender handle and the signatur for the content
// It is needed for relayed comments to Diaspora.
if ($item['signed_text']) {
- $sign = base64_encode(json_encode(['signed_text' => $item['signed_text'],'signature' => $item['signature'],'signer' => $item['signer']]));
+ $sign = base64_encode(json_encode(['signed_text' => $item['signed_text'],'signature' => '','signer' => '']));
XML::addElement($doc, $entry, "dfrn:diaspora_signature", $sign);
}
$item["guid"] = XML::getFirstNodeValue($xpath, "dfrn:diaspora_guid/text()", $entry);
+ $item['uri-id'] = ItemURI::insert(['uri' => $item['uri'], 'guid' => $item['guid']]);
+
// We store the data from "dfrn:diaspora_signature" in a different table, this is done in "Item::insert"
$dsprsig = XML::unescape(XML::getFirstNodeValue($xpath, "dfrn:diaspora_signature/text()", $entry));
if ($dsprsig != "") {
}
$item["tag"] .= $termhash . "[url=" . $termurl . "]" . $term . "[/url]";
+
+ // Store the hashtag/mention
+ $fields = ['uri-id' => $item['uri-id'], 'name' => substr($term, 0, 64)];
+
+ if ($termhash == Term::TAG_CHARACTER[Term::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::HASHTAG;
+ }
+
+ if (!empty($termurl)) {
+ $fields['url'] = $termurl;
+ }
+
+ DBA::insert('tag', $fields, true);
+
+ Logger::info('Stored tag/mention', ['uri-id' => $item['uri-id'], 'tag' => $term, 'url' => $termurl, 'hash' => $termhash, 'fields' => $fields]);
}
}
}