Changed detection for specific software

This commit is contained in:
Michael 2019-08-28 09:10:25 +00:00
parent 9cbf320c86
commit ed4d08c7f4

View file

@ -81,7 +81,7 @@ class ContactSelector
$server_url = ''; $server_url = '';
// Fetch the server url from the contact table // Fetch the server url from the contact table
$contact = DBA::selectFirst('contact', ['baseurl'], ['nurl' => Strings::normaliseLink($profile)]); $contact = DBA::selectFirst('contact', ['baseurl'], ['uid' => 0, 'nurl' => Strings::normaliseLink($profile)]);
if (DBA::isResult($contact) && !empty($contact['baseurl'])) { if (DBA::isResult($contact) && !empty($contact['baseurl'])) {
$server_url = Strings::normaliseLink($contact['baseurl']); $server_url = Strings::normaliseLink($contact['baseurl']);
} }
@ -174,21 +174,21 @@ class ContactSelector
{ {
$nets = [ $nets = [
Protocol::DFRN => 'friendica', Protocol::DFRN => 'friendica',
Protocol::OSTATUS => 'gnu-social', Protocol::OSTATUS => 'gnu-social', // There is no generic OStatus icon
Protocol::FEED => 'rss', Protocol::FEED => 'rss',
Protocol::MAIL => '', Protocol::MAIL => 'file-text-o', /// @todo
Protocol::DIASPORA => 'diaspora', Protocol::DIASPORA => 'diaspora',
Protocol::ZOT => 'hubzilla', Protocol::ZOT => 'hubzilla',
Protocol::LINKEDIN => 'linkedin', Protocol::LINKEDIN => 'linkedin',
Protocol::XMPP => 'xmpp', Protocol::XMPP => 'xmpp',
Protocol::MYSPACE => '', Protocol::MYSPACE => 'file-text-o', /// @todo
Protocol::GPLUS => 'google-plus', Protocol::GPLUS => 'google-plus',
Protocol::PUMPIO => '', Protocol::PUMPIO => 'file-text-o', /// @todo
Protocol::TWITTER => 'twitter', Protocol::TWITTER => 'twitter',
Protocol::DIASPORA2 => 'diaspora', Protocol::DIASPORA2 => 'diaspora',
Protocol::STATUSNET => 'gnu-social', Protocol::STATUSNET => 'gnu-social',
Protocol::ACTIVITYPUB => 'activitypub', Protocol::ACTIVITYPUB => 'activitypub',
Protocol::PNUT => '', Protocol::PNUT => 'file-text-o', /// @todo
]; ];
$search = array_keys($nets); $search = array_keys($nets);
@ -203,25 +203,30 @@ class ContactSelector
$gserver = DBA::selectFirst('gserver', ['platform'], ['nurl' => $server_url]); $gserver = DBA::selectFirst('gserver', ['platform'], ['nurl' => $server_url]);
if (DBA::isResult($gserver) && !empty($gserver['platform'])) { if (DBA::isResult($gserver) && !empty($gserver['platform'])) {
switch (strtolower($gserver['platform'])) { /*
case 'friendica': BlackGerman.space
$networkicon = 'friendica'; ganggo
break; groundpolis
case 'hubzilla': Juick
$networkicon = 'hubzilla'; misskey
break; mobilizon
case 'mastodon': MounKareal
$networkicon = 'mastodon'; read.as
break; social-relay
case 'pleroma': twista
$networkicon = 'pleroma'; writefreely
break;
}
}
}
if (empty($networkicon)) { ostatus
$networkicon = 'file-text-o'; red
redmatrix
StatusNet
*/
$icons = ['diaspora' => 'diaspora', 'friendica' => 'friendica', 'friendika' => 'friendica',
'GNU Social' => 'gnu-social', 'gnusocial' => 'gnu-social', 'hubzilla' => 'hubzilla',
'mastodon' => 'mastodon', 'peertube' => 'peertube', 'pixelfed' => 'pixelfed',
'pleroma' => 'pleroma', 'socialhome' => 'social-home', 'wordpress' => 'wordpress'];
$networkicon = $icons[strtolower($gserver['platform'])] ?? $networkicon;
}
} }
return $networkicon; return $networkicon;