]> git.mxchange.org Git - friendica.git/commitdiff
Add expected "users" property to NodeInfo usage property for all versions
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 23 Jul 2022 17:21:44 +0000 (13:21 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 23 Jul 2022 17:21:44 +0000 (13:21 -0400)
src/Model/Nodeinfo.php
src/Module/NodeInfo110.php
src/Module/NodeInfo120.php
src/Module/NodeInfo210.php

index 047fe0e58a6c711b27ac195623cb2e80afef0761..84a14a294d5c3ab0f4c2d7c5d90f68bbebddcca7 100644 (file)
@@ -79,6 +79,7 @@ class Nodeinfo
                $config = DI::config();
 
                $usage = new stdClass();
+               $usage->users = [];
 
                if (!empty($config->get('system', 'nodeinfo'))) {
                        $usage->users = [
index 9935e9089a24219ea891bf6abc119cb1a3fd922f..a308f8e6f581366dbc751ad8e28b1e94dc3969ae 100644 (file)
@@ -63,8 +63,8 @@ class NodeInfo110 extends BaseModule
                                        'friendica'
                                ],
                        ],
-                       'services'          => [],
-                       'usage'             => [],
+                       'services'          => Nodeinfo::getServices(),
+                       'usage'             => Nodeinfo::getUsage(),
                        'openRegistrations' => intval($this->config->get('config', 'register_policy')) !== Register::CLOSED,
                        'metadata'          => [
                                'nodeName' => $this->config->get('config', 'sitename'),
@@ -81,10 +81,6 @@ class NodeInfo110 extends BaseModule
                        $nodeinfo['protocols']['outbound'][] = 'gnusocial';
                }
 
-               $nodeinfo['usage'] = Nodeinfo::getUsage();
-
-               $nodeinfo['services'] = Nodeinfo::getServices();
-
                $nodeinfo['metadata']['protocols']               = $nodeinfo['protocols'];
                $nodeinfo['metadata']['protocols']['outbound'][] = 'atom1.0';
                $nodeinfo['metadata']['protocols']['inbound'][]  = 'atom1.0';
index 34bff3742590668c1924be500b79b4eb723d58ce..3e6a69b7493005aae9fb41e334aee38dbb36d48d 100644 (file)
@@ -56,8 +56,8 @@ class NodeInfo120 extends BaseModule
                                'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION,
                        ],
                        'protocols'         => ['dfrn', 'activitypub'],
-                       'services'          => [],
-                       'usage'             => [],
+                       'services'          => Nodeinfo::getServices(),
+                       'usage'             => Nodeinfo::getUsage(),
                        'openRegistrations' => intval($this->config->get('config', 'register_policy')) !== Register::CLOSED,
                        'metadata'          => [
                                'nodeName' => $this->config->get('config', 'sitename'),
@@ -72,10 +72,6 @@ class NodeInfo120 extends BaseModule
                        $nodeinfo['protocols'][] = 'ostatus';
                }
 
-               $nodeinfo['usage'] = Nodeinfo::getUsage();
-
-               $nodeinfo['services'] = Nodeinfo::getServices();
-
                if (Addon::isEnabled('twitter')) {
                        $nodeinfo['services']['inbound'][] = 'twitter';
                }
index 7e9291b4928947c077e4b6f64d6a01f2d04b23c8..723736a6185ad015f4703b5eec51d1360680cdce 100644 (file)
@@ -59,9 +59,9 @@ class NodeInfo210 extends BaseModule
                        ],
                        'organization'      => Nodeinfo::getOrganization($this->config),
                        'protocols'         => ['dfrn', 'activitypub'],
-                       'services'          => [],
+                       'services'          => Nodeinfo::getServices(),
                        'openRegistrations' => intval($this->config->get('config', 'register_policy')) !== Register::CLOSED,
-                       'usage'             => [],
+                       'usage'             => Nodeinfo::getUsage(true),
                ];
 
                if (!empty($this->config->get('system', 'diaspora_enabled'))) {
@@ -72,10 +72,6 @@ class NodeInfo210 extends BaseModule
                        $nodeinfo['protocols'][] = 'ostatus';
                }
 
-               $nodeinfo['usage'] = Nodeinfo::getUsage(true);
-
-               $nodeinfo['services'] = Nodeinfo::getServices();
-
                if (Addon::isEnabled('twitter')) {
                        $nodeinfo['services']['inbound'][] = 'twitter';
                }