- moved constants GRAVITY_* from boot.php to Friendica\Model\Item
- also rewrote some array initialization:

From:
````
<?php
$arr = [];
$arr['foo'] = "FOO";
````

To:
````
<?php
$arr['foo'] = "FOO";
````
- added a few type-hints
This commit is contained in:
Roland Häder 2022-09-12 23:12:11 +02:00
parent e5ae5c7e67
commit da66730e4f
No known key found for this signature in database
GPG key ID: C82EDE5DDFA0BA77
77 changed files with 547 additions and 513 deletions

View file

@ -22,6 +22,7 @@
namespace Friendica\Core;
use Friendica\Database\DBA;
use Friendica\Model\Item;
use Friendica\Model\User;
use Friendica\Network\HTTPException;
use Friendica\Protocol\Activity;
@ -139,7 +140,7 @@ class Protocol
// create a follow slap
$item = [
'verb' => Activity::FOLLOW,
'gravity' => GRAVITY_ACTIVITY,
'gravity' => Item::GRAVITY_ACTIVITY,
'follow' => $contact['url'],
'body' => '',
'title' => '',
@ -191,14 +192,16 @@ class Protocol
if (in_array($protocol, [Protocol::OSTATUS, Protocol::DFRN])) {
// create an unfollow slap
$item = [];
$item['verb'] = Activity::O_UNFOLLOW;
$item['gravity'] = GRAVITY_ACTIVITY;
$item['follow'] = $contact['url'];
$item['body'] = '';
$item['title'] = '';
$item['guid'] = '';
$item['uri-id'] = 0;
$item = [
'verb' => Activity::O_UNFOLLOW,
'gravity' => Item::GRAVITY_ACTIVITY,
'follow' => $contact['url'],
'body' => '',
'title' => '',
'guid' => '',
'uri-id' => 0,
];
$slap = OStatus::salmon($item, $user);
if (empty($contact['notify'])) {