mirror of
https://github.com/friendica/friendica
synced 2024-12-24 18:00:15 +00:00
AP: Support of request messages
This commit is contained in:
parent
33931ff15e
commit
2365193691
2 changed files with 5 additions and 3 deletions
|
@ -2085,7 +2085,7 @@ class Contact extends BaseObject
|
||||||
return $contact;
|
return $contact;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function addRelationship($importer, $contact, $datarray, $item = '', $sharing = false) {
|
public static function addRelationship($importer, $contact, $datarray, $item = '', $sharing = false, $note = '') {
|
||||||
// Should always be set
|
// Should always be set
|
||||||
if (empty($datarray['author-id'])) {
|
if (empty($datarray['author-id'])) {
|
||||||
return;
|
return;
|
||||||
|
@ -2163,7 +2163,7 @@ class Contact extends BaseObject
|
||||||
|
|
||||||
if (is_array($contact_record)) {
|
if (is_array($contact_record)) {
|
||||||
DBA::insert('intro', ['uid' => $importer['uid'], 'contact-id' => $contact_record['id'],
|
DBA::insert('intro', ['uid' => $importer['uid'], 'contact-id' => $contact_record['id'],
|
||||||
'blocked' => false, 'knowyou' => false,
|
'blocked' => false, 'knowyou' => false, 'note' => $note,
|
||||||
'hash' => $hash, 'datetime' => DateTimeFormat::utcNow()]);
|
'hash' => $hash, 'datetime' => DateTimeFormat::utcNow()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -463,10 +463,12 @@ class Processor
|
||||||
$item = ['author-id' => Contact::getIdForURL($activity['actor']),
|
$item = ['author-id' => Contact::getIdForURL($activity['actor']),
|
||||||
'author-link' => $activity['actor']];
|
'author-link' => $activity['actor']];
|
||||||
|
|
||||||
|
$note = Strings::escapeTags(trim(defaults($activity, 'content', '')));
|
||||||
|
|
||||||
// Ensure that the contact has got the right network type
|
// Ensure that the contact has got the right network type
|
||||||
self::switchContact($item['author-id']);
|
self::switchContact($item['author-id']);
|
||||||
|
|
||||||
Contact::addRelationship($owner, $contact, $item);
|
Contact::addRelationship($owner, $contact, $item, '', false, $note);
|
||||||
$cid = Contact::getIdForURL($activity['actor'], $uid);
|
$cid = Contact::getIdForURL($activity['actor'], $uid);
|
||||||
if (empty($cid)) {
|
if (empty($cid)) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue