Merge pull request #8782 from annando/notice

Hopefully fixes notice "Undefined index: gravity"
This commit is contained in:
Hypolite Petovan 2020-06-16 17:10:52 -04:00 committed by GitHub
commit 1abde8133a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -843,6 +843,7 @@ class Contact
// create an unfollow slap // create an unfollow slap
$item = []; $item = [];
$item['verb'] = Activity::O_UNFOLLOW; $item['verb'] = Activity::O_UNFOLLOW;
$item['gravity'] = GRAVITY_ACTIVITY;
$item['follow'] = $contact["url"]; $item['follow'] = $contact["url"];
$item['body'] = ''; $item['body'] = '';
$item['title'] = ''; $item['title'] = '';
@ -2470,6 +2471,7 @@ class Contact
// create a follow slap // create a follow slap
$item = []; $item = [];
$item['verb'] = Activity::FOLLOW; $item['verb'] = Activity::FOLLOW;
$item['gravity'] = GRAVITY_ACTIVITY;
$item['follow'] = $contact["url"]; $item['follow'] = $contact["url"];
$item['body'] = ''; $item['body'] = '';
$item['title'] = ''; $item['title'] = '';

View file

@ -989,7 +989,7 @@ class Processor
$parent_author = Contact::getDetailsByURL($parent['author-link'], 0); $parent_author = Contact::getDetailsByURL($parent['author-link'], 0);
$implicit_mentions = []; $implicit_mentions = [];
if (empty($parent_author)) { if (empty($parent_author['url'])) {
Logger::notice('Author public contact unknown.', ['author-link' => $parent['author-link'], 'item-id' => $parent['id']]); Logger::notice('Author public contact unknown.', ['author-link' => $parent['author-link'], 'item-id' => $parent['id']]);
} else { } else {
$implicit_mentions[] = $parent_author['url']; $implicit_mentions[] = $parent_author['url'];
@ -1003,7 +1003,7 @@ class Processor
foreach ($parent_terms as $term) { foreach ($parent_terms as $term) {
$contact = Contact::getDetailsByURL($term['url'], 0); $contact = Contact::getDetailsByURL($term['url'], 0);
if (!empty($contact)) { if (!empty($contact['url'])) {
$implicit_mentions[] = $contact['url']; $implicit_mentions[] = $contact['url'];
$implicit_mentions[] = $contact['nurl']; $implicit_mentions[] = $contact['nurl'];
$implicit_mentions[] = $contact['alias']; $implicit_mentions[] = $contact['alias'];