]> git.mxchange.org Git - friendica.git/commitdiff
AP: Support of request messages
authorMichael Vogel <icarus@dabo.de>
Sun, 5 May 2019 09:17:45 +0000 (11:17 +0200)
committerMichael Vogel <icarus@dabo.de>
Sun, 5 May 2019 09:17:45 +0000 (11:17 +0200)
src/Model/Contact.php
src/Protocol/ActivityPub/Processor.php

index 5d62383dc18ff0b81ff9b25c586ffada129c9ad7..059a65e57cdf92f2cc1323f573d507b480ecb841 100644 (file)
@@ -2085,7 +2085,7 @@ class Contact extends BaseObject
                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
                if (empty($datarray['author-id'])) {
                        return;
@@ -2163,7 +2163,7 @@ class Contact extends BaseObject
 
                                if (is_array($contact_record)) {
                                        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()]);
                                }
 
index 58920487012b13a570140770b434b17a052aa9f0..15ec610e502aa9646d1a0758f31f5abd7c8e4daf 100644 (file)
@@ -463,10 +463,12 @@ class Processor
                $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;