]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/ACL.php
Stopped using deprecated constants NETWORK_* (#5537)
[friendica.git] / src / Core / ACL.php
index 11af99af660a2c69b110b7a488aa2c5e22bc3811..0b996bfe9b6a3fea4817b3f4a6e469956643efe8 100644 (file)
@@ -8,6 +8,7 @@ namespace Friendica\Core;
 
 use Friendica\BaseObject;
 use Friendica\Content\Feature;
+use Friendica\Core\Protocol;
 use Friendica\Database\DBA;
 use Friendica\Model\Contact;
 use Friendica\Model\GContact;
@@ -46,18 +47,21 @@ class ACL extends BaseObject
 
                switch (defaults($options, 'networks', Protocol::PHANTOM)) {
                        case 'DFRN_ONLY':
-                               $networks = [NETWORK_DFRN];
+                               $networks = [Protocol::DFRN];
                                break;
+
                        case 'PRIVATE':
-                               $networks = [NETWORK_DFRN, NETWORK_MAIL, NETWORK_DIASPORA];
+                               $networks = [Protocol::DFRN, Protocol::MAIL, Protocol::DIASPORA];
                                break;
+
                        case 'TWO_WAY':
                                if (!empty($a->user['prvnets'])) {
-                                       $networks = [NETWORK_DFRN, NETWORK_MAIL, NETWORK_DIASPORA];
+                                       $networks = [Protocol::DFRN, Protocol::MAIL, Protocol::DIASPORA];
                                } else {
-                                       $networks = [NETWORK_DFRN, NETWORK_MAIL, NETWORK_DIASPORA, NETWORK_OSTATUS];
+                                       $networks = [Protocol::DFRN, Protocol::MAIL, Protocol::DIASPORA, Protocol::OSTATUS];
                                }
                                break;
+
                        default: /// @TODO Maybe log this call?
                                break;
                }
@@ -148,7 +152,7 @@ class ACL extends BaseObject
                // When used for private messages, we limit correspondence to mutual DFRN/Friendica friends and the selector
                // to one recipient. By default our selector allows multiple selects amongst all contacts.
                $sql_extra = sprintf(" AND `rel` = %d ", intval(Contact::FRIEND));
-               $sql_extra .= sprintf(" AND `network` IN ('%s' , '%s') ", NETWORK_DFRN, NETWORK_DIASPORA);
+               $sql_extra .= sprintf(" AND `network` IN ('%s' , '%s') ", Protocol::DFRN, Protocol::DIASPORA);
 
                $tabindex_attr = !empty($tabindex) ? ' tabindex="' . intval($tabindex) . '"' : '';