]> git.mxchange.org Git - friendica.git/commitdiff
Rewrite:
authorRoland Häder <roland@mxchange.org>
Mon, 12 Sep 2022 21:12:11 +0000 (23:12 +0200)
committerRoland Häder <roland@mxchange.org>
Mon, 23 Jun 2025 20:53:13 +0000 (22:53 +0200)
- 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

src/Model/Contact.php
src/Protocol/DFRN.php

index 4684317e7696617f98a94dcae80ebfb1c5e97cb6..6d63fc192a80b66b210fd71c415caceff321d616 100644 (file)
@@ -1655,7 +1655,7 @@ class Contact
                        $condition = ["`uid` = ?", $uid];
                }
 
-               $contact_field = ((($contact["contact-type"] == self::TYPE_COMMUNITY) || ($contact['network'] == Protocol::MAIL)) ? 'owner-id' : 'author-id');
+               $contact_field = ((($contact['contact-type'] == self::TYPE_COMMUNITY) || ($contact['network'] == Protocol::MAIL)) ? 'owner-id' : 'author-id');
 
                $condition = DBA::mergeConditions($condition, ["`$contact_field` = ? AND `gravity` IN (?, ?)", $cid, Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT]);
 
index 56cafc1a9768bc767cf9238e26f6caf9c85cad0d..c553c8789dc43fdfefb31b6b6bae35038ccd5b29 100644 (file)
@@ -1598,6 +1598,7 @@ class DFRN
                                || ($item['verb'] == Activity::ANNOUNCE)
                        ) {
                                $item['gravity'] = Item::GRAVITY_ACTIVITY;
+
                                // only one like or dislike per person
                                // split into two queries for performance issues
                                $condition = [