$cid = Contact::getIdForURL($activity['actor'], $uid);
if (!empty($cid)) {
self::switchContact($cid);
- DBA::update('contact', ['hub-verify' => $activity['id']], ['id' => $cid]);
+ DBA::update('contact', ['hub-verify' => $activity['id'], 'protocol' => Protocol::ACTIVITYPUB], ['id' => $cid]);
$contact = DBA::selectFirst('contact', [], ['id' => $cid, 'network' => Protocol::NATIVE_SUPPORT]);
} else {
$contact = false;
$item = ['author-id' => Contact::getIdForURL($activity['actor']),
'author-link' => $activity['actor']];
+ $note = Strings::escapeTags(trim(defaults($activity, 'content', '')));
+
// Ensure that the contact has got the right network type
self::switchContact($item['author-id']);
- Contact::addRelationship($owner, $contact, $item);
+ Contact::addRelationship($owner, $contact, $item, '', false, $note);
$cid = Contact::getIdForURL($activity['actor'], $uid);
if (empty($cid)) {
return;
}
if (empty($contact)) {
- DBA::update('contact', ['hub-verify' => $activity['id']], ['id' => $cid]);
+ DBA::update('contact', ['hub-verify' => $activity['id'], 'protocol' => Protocol::ACTIVITYPUB], ['id' => $cid]);
}
Logger::log('Follow user ' . $uid . ' from contact ' . $cid . ' with id ' . $activity['id']);