mirror of
https://github.com/friendica/friendica
synced 2025-04-28 22:24:22 +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
|
@ -23,6 +23,7 @@ namespace Friendica\Object\Api\Mastodon;
|
|||
|
||||
use Friendica\BaseDataTransferObject;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Object\Api\Mastodon\Status\Counts;
|
||||
use Friendica\Object\Api\Mastodon\Status\UserAttributes;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
|
@ -102,7 +103,7 @@ class Status extends BaseDataTransferObject
|
|||
$this->id = (string)$item['uri-id'];
|
||||
$this->created_at = DateTimeFormat::utc($item['created'], DateTimeFormat::JSON);
|
||||
|
||||
if ($item['gravity'] == GRAVITY_COMMENT) {
|
||||
if ($item['gravity'] == Item::GRAVITY_COMMENT) {
|
||||
$this->in_reply_to_id = (string)$item['thr-parent-id'];
|
||||
$this->in_reply_to_account_id = (string)$item['parent-author-id'];
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ class Status extends BaseDataTransferObject
|
|||
|
||||
$this->created_at = DateTimeFormat::utc($item['created'], DateTimeFormat::API);
|
||||
|
||||
if ($item['gravity'] == GRAVITY_COMMENT) {
|
||||
if ($item['gravity'] == Item::GRAVITY_COMMENT) {
|
||||
$this->in_reply_to_status_id = (int)$item['thr-parent-id'];
|
||||
$this->in_reply_to_status_id_str = (string)$item['thr-parent-id'];
|
||||
$this->in_reply_to_user_id = (int)$item['parent-author-id'];
|
||||
|
|
|
@ -210,7 +210,7 @@ class Post
|
|||
$announceable = $shareable && in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::TWITTER]);
|
||||
|
||||
// On Diaspora only toplevel posts can be reshared
|
||||
if ($announceable && ($item['network'] == Protocol::DIASPORA) && ($item['gravity'] != GRAVITY_PARENT)) {
|
||||
if ($announceable && ($item['network'] == Protocol::DIASPORA) && ($item['gravity'] != Item::GRAVITY_PARENT)) {
|
||||
$announceable = false;
|
||||
}
|
||||
|
||||
|
@ -915,7 +915,7 @@ class Post
|
|||
return $text;
|
||||
}
|
||||
|
||||
if (($item['author-addr'] != $owner['addr']) && (($item['gravity'] != GRAVITY_PARENT) || !in_array($item['network'], [Protocol::DIASPORA]))) {
|
||||
if (($item['author-addr'] != $owner['addr']) && (($item['gravity'] != Item::GRAVITY_PARENT) || !in_array($item['network'], [Protocol::DIASPORA]))) {
|
||||
$text .= '@' . $item['author-addr'] . ' ';
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue