| @@ -5,8 +5,9 @@ | ||
| 5 | 5 | |
| 6 | 6 | use function Activitypub\get_total_users; |
| 7 | 7 | use function Activitypub\get_active_users; |
| 8 | 8 | use function Activitypub\get_rest_url_by_path; |
| 9 | +use function Activitypub\get_masked_wp_version; | |
| 9 | 10 | |
| 10 | 11 | /** |
| 11 | 12 | * ActivityPub NodeInfo REST-Class |
| 12 | 13 | * |
| @@ -80,9 +81,9 @@ | ||
| 80 | 81 | |
| 81 | 82 | $nodeinfo['version'] = '2.0'; |
| 82 | 83 | $nodeinfo['software'] = array( |
| 83 | 84 | 'name' => 'wordpress', |
| 84 | - 'version' => \get_bloginfo( 'version' ), | |
| 85 | + 'version' => get_masked_wp_version(), | |
| 85 | 86 | ); |
| 86 | 87 | |
| 87 | 88 | $posts = \wp_count_posts(); |
| 88 | 89 | $comments = \wp_count_comments(); |
| @@ -104,8 +105,14 @@ | ||
| 104 | 105 | 'inbound' => array(), |
| 105 | 106 | 'outbound' => array(), |
| 106 | 107 | ); |
| 107 | 108 | |
| 109 | + $nodeinfo['metadata'] = array( | |
| 110 | + 'nodeName' => \get_bloginfo( 'name' ), | |
| 111 | + 'nodeDescription' => \get_bloginfo( 'description' ), | |
| 112 | + 'nodeIcon' => \get_site_icon_url(), | |
| 113 | + ); | |
| 114 | + | |
| 108 | 115 | return new WP_REST_Response( $nodeinfo, 200 ); |
| 109 | 116 | } |
| 110 | 117 | |
| 111 | 118 | /** |
| @@ -122,14 +129,14 @@ | ||
| 122 | 129 | \do_action( 'activitypub_rest_nodeinfo2_pre' ); |
| 123 | 130 | |
| 124 | 131 | $nodeinfo = array(); |
| 125 | 132 | |
| 126 | - $nodeinfo['version'] = '1.0'; | |
| 133 | + $nodeinfo['version'] = '2.0'; | |
| 127 | 134 | $nodeinfo['server'] = array( |
| 128 | 135 | 'baseUrl' => \home_url( '/' ), |
| 129 | 136 | 'name' => \get_bloginfo( 'name' ), |
| 130 | 137 | 'software' => 'wordpress', |
| 131 | - 'version' => \get_bloginfo( 'version' ), | |
| 138 | + 'version' => get_masked_wp_version(), | |
| 132 | 139 | ); |
| 133 | 140 | |
| 134 | 141 | $posts = \wp_count_posts(); |
| 135 | 142 | $comments = \wp_count_comments(); |
| @@ -167,8 +174,12 @@ | ||
| 167 | 174 | $discovery['links'] = array( |
| 168 | 175 | array( |
| 169 | 176 | 'rel' => 'http://nodeinfo.diaspora.software/ns/schema/2.0', |
| 170 | 177 | 'href' => get_rest_url_by_path( 'nodeinfo' ), |
| 178 | + ), | |
| 179 | + array( | |
| 180 | + 'rel' => 'https://www.w3.org/ns/activitystreams#Application', | |
| 181 | + 'href' => get_rest_url_by_path( 'application' ), | |
| 171 | 182 | ), |
| 172 | 183 | ); |
| 173 | 184 | |
| 174 | 185 | return new \WP_REST_Response( $discovery, 200 ); |