mirror of
https://github.com/friendica/friendica
synced 2025-05-04 07:04:10 +02:00
Rewrite:
- 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:
parent
e5ae5c7e67
commit
da66730e4f
77 changed files with 547 additions and 513 deletions
|
@ -391,7 +391,7 @@ class OStatus
|
|||
$header['network'] = Protocol::OSTATUS;
|
||||
$header['wall'] = 0;
|
||||
$header['origin'] = 0;
|
||||
$header['gravity'] = GRAVITY_COMMENT;
|
||||
$header['gravity'] = Item::GRAVITY_COMMENT;
|
||||
|
||||
if (!is_object($doc->firstChild) || empty($doc->firstChild->tagName)) {
|
||||
return false;
|
||||
|
@ -499,7 +499,7 @@ class OStatus
|
|||
|
||||
$item['verb'] = Activity::LIKE;
|
||||
$item['thr-parent'] = $orig_uri;
|
||||
$item['gravity'] = GRAVITY_ACTIVITY;
|
||||
$item['gravity'] = Item::GRAVITY_ACTIVITY;
|
||||
$item['object-type'] = Activity\ObjectType::NOTE;
|
||||
}
|
||||
|
||||
|
@ -714,7 +714,7 @@ class OStatus
|
|||
}
|
||||
} else {
|
||||
$item['thr-parent'] = $item['uri'];
|
||||
$item['gravity'] = GRAVITY_PARENT;
|
||||
$item['gravity'] = Item::GRAVITY_PARENT;
|
||||
}
|
||||
|
||||
self::$itemlist[] = $item;
|
||||
|
@ -1359,7 +1359,7 @@ class OStatus
|
|||
*/
|
||||
private static function likeEntry(DOMDocument $doc, array $item, array $owner, bool $toplevel): DOMElement
|
||||
{
|
||||
if (($item['gravity'] != GRAVITY_PARENT) && (Strings::normaliseLink($item['author-link']) != Strings::normaliseLink($owner['url']))) {
|
||||
if (($item['gravity'] != Item::GRAVITY_PARENT) && (Strings::normaliseLink($item['author-link']) != Strings::normaliseLink($owner['url']))) {
|
||||
Logger::info('OStatus entry is from author ' . $owner['url'] . ' - not from ' . $item['author-link'] . '. Quitting.');
|
||||
}
|
||||
|
||||
|
@ -1509,7 +1509,7 @@ class OStatus
|
|||
*/
|
||||
private static function noteEntry(DOMDocument $doc, array $item, array $owner, bool $toplevel): DOMElement
|
||||
{
|
||||
if (($item['gravity'] != GRAVITY_PARENT) && (Strings::normaliseLink($item['author-link']) != Strings::normaliseLink($owner['url']))) {
|
||||
if (($item['gravity'] != Item::GRAVITY_PARENT) && (Strings::normaliseLink($item['author-link']) != Strings::normaliseLink($owner['url']))) {
|
||||
Logger::info('OStatus entry is from author ' . $owner['url'] . ' - not from ' . $item['author-link'] . '. Quitting.');
|
||||
}
|
||||
|
||||
|
@ -1639,7 +1639,7 @@ class OStatus
|
|||
{
|
||||
$mentioned = [];
|
||||
|
||||
if ($item['gravity'] != GRAVITY_PARENT) {
|
||||
if ($item['gravity'] != Item::GRAVITY_PARENT) {
|
||||
$parent = Post::selectFirst(['guid', 'author-link', 'owner-link'], ['id' => $item['parent']]);
|
||||
|
||||
$thrparent = Post::selectFirst(['guid', 'author-link', 'owner-link', 'plink'], ['uid' => $owner['uid'], 'uri' => $item['thr-parent']]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue