]> 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>
Wed, 17 Jan 2024 00:02:59 +0000 (01:02 +0100)
- 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 6442784f73758cc8741af6eb0324c07a24f669b6..7873cb2dbab2a3ead687469dcfe4661895212bd0 100644 (file)
@@ -1592,7 +1592,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 4d44b8a40fe3f4f17b6f3ef1eb18bd17bbd76fba..f989ac62c50cc0854412f8bf42ded25aa4df99ad 100644 (file)
@@ -1622,6 +1622,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 = [