]> git.mxchange.org Git - friendica.git/commitdiff
Pleroma-Servers are now detected and displayed in the statistics
authorMichael <heluecht@pirati.ca>
Tue, 29 Aug 2017 16:40:08 +0000 (16:40 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 29 Aug 2017 16:40:08 +0000 (16:40 +0000)
include/socgraph.php
include/text.php
mod/admin.php

index d3f70075b2ffe1cf2b8ab3e3051df4ad538fee29..d944fa064c944c4bce4be80de3c08fd40a1aefbf 100644 (file)
@@ -1146,6 +1146,7 @@ function poco_check_server($server_url, $network = "", $force = false) {
                }
 
                // Test for Mastodon
+               $orig_version = $version;
                $serverret = z_fetch_url($server_url."/api/v1/instance");
                if ($serverret["success"] && ($serverret["body"] != '')) {
                        $data = json_decode($serverret["body"]);
@@ -1157,6 +1158,9 @@ function poco_check_server($server_url, $network = "", $force = false) {
                                $network = NETWORK_OSTATUS;
                        }
                }
+               if (strstr($orig_version, 'Pleroma')) {
+                       $platform = 'Pleroma';
+               }
        }
 
        if (!$failure) {
@@ -1169,7 +1173,9 @@ function poco_check_server($server_url, $network = "", $force = false) {
                                $version = $data->version;
                                $network = NETWORK_DIASPORA;
                        }
-                       $site_name = $data->site_name;
+                       if (!empty($data->site_name)) {
+                               $site_name = $data->site_name;
+                       }
                        switch ($data->register_policy) {
                                case "REGISTER_OPEN":
                                        $register_policy = REGISTER_OPEN;
@@ -1249,9 +1255,11 @@ function poco_check_server($server_url, $network = "", $force = false) {
                                $version = preg_replace("=(.+)-(.{4,})=ism", "$1", $version);
                        }
 
-                       $site_name = $data->name;
+                       if (!empty($data->name)) {
+                               $site_name = $data->name;
+                       }
 
-                       if (isset($data->network)) {
+                       if (!empty($data->network)) {
                                $platform = $data->network;
                        }
 
index 9cd861fa55bee80bfe6ec3328f92ff8bfd8b42e1..9b7b47a773247416a2c8917367d055641faba4c1 100644 (file)
@@ -1425,6 +1425,7 @@ function prepare_body(&$item, $attach = false, $preview = false) {
                                        $title .= ' ' . $mtch[2] . ' ' . t('bytes');
 
                                        if (($filetype == 'image') AND ($item['network'] == NETWORK_OSTATUS)) {
+                                               /// @todo Respect the spoiler for mastodon
                                                $icon = '<img class="attached" src="'.$the_url.'" alt="" title="'.$title.'">';
                                                $s .= '<br><a href="' . strip_tags($the_url) . '" title="' . $title . '" class="attached" target="_blank" >' . $icon . '</a>';
                                        } else {
index 291907667539724f1abaf20cba1f996023c76564..c5043f2252e22cb767f61359b93f16513c64b7a2 100644 (file)
@@ -441,7 +441,7 @@ function admin_page_federation(App $a) {
        // off one % two of them are needed in the query
        // Add more platforms if you like, when one returns 0 known nodes it is not
        // displayed on the stats page.
-       $platforms = array('Friendi%%a', 'Diaspora', '%%red%%', 'Hubzilla', 'BlaBlaNet', 'GNU Social', 'StatusNet', 'Mastodon');
+       $platforms = array('Friendi%%a', 'Diaspora', '%%red%%', 'Hubzilla', 'BlaBlaNet', 'GNU Social', 'StatusNet', 'Mastodon', 'Pleroma');
        $colors    = array('Friendi%%a' => '#ffc018',     // orange from the logo
                           'Diaspora'  => '#a1a1a1',     // logo is black and white, makes a gray
                           '%%red%%'   => '#c50001',     // fire red from the logo
@@ -449,7 +449,8 @@ function admin_page_federation(App $a) {
                           'BlaBlaNet' => '#3B5998',     // blue from the navbar at blablanet-dot-com
                           'GNU Social'=> '#a22430',     // dark red from the logo
                           'StatusNet' => '#789240',     // the green from the logo (red and blue have already others
-                          'Mastodon'  => '#1a9df9');    // blue from the Mastodon logo
+                          'Mastodon'  => '#1a9df9',    // blue from the Mastodon logo
+                          'Pleroma'  => '#E46F0F');    // Orange from the text that is used on Pleroma instances
        $counts = array();
        $total = 0;