use Friendica\Util\Strings;
/**
- * @brief ContactSelector class
+ * ContactSelector class
*/
class ContactSelector
{
}
/**
- * @param string $network network
- * @param string $profile optional, default empty
+ * @param string $network network of the contact
+ * @param string $profile optional, default empty
+ * @param string $protocol (Optional) Protocol that is used for the transmission
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public static function networkToName($network, $profile = "")
+ public static function networkToName($network, $profile = '', $protocol = '')
{
$nets = [
Protocol::DFRN => L10n::t('DFRN'),
Protocol::GPLUS => L10n::t('Google+'),
Protocol::PUMPIO => L10n::t('pump.io'),
Protocol::TWITTER => L10n::t('Twitter'),
+ Protocol::DISCOURSE => L10n::t('Discourse'),
Protocol::DIASPORA2 => L10n::t('Diaspora Connector'),
Protocol::STATUSNET => L10n::t('GNU Social Connector'),
Protocol::ACTIVITYPUB => L10n::t('ActivityPub'),
}
}
+ if (!empty($protocol) && ($protocol != $network)) {
+ $networkname = L10n::t('%s (via %s)', $networkname, self::networkToName($protocol));
+ }
+
return $networkname;
}
Protocol::DFRN => 'friendica',
Protocol::OSTATUS => 'gnu-social', // There is no generic OStatus icon
Protocol::FEED => 'rss',
- Protocol::MAIL => 'file-text-o', /// @todo
+ Protocol::MAIL => 'inbox',
Protocol::DIASPORA => 'diaspora',
Protocol::ZOT => 'hubzilla',
Protocol::LINKEDIN => 'linkedin',
Protocol::GPLUS => 'google-plus',
Protocol::PUMPIO => 'file-text-o', /// @todo
Protocol::TWITTER => 'twitter',
+ Protocol::DISCOURSE => 'dot-circle-o', /// @todo
Protocol::DIASPORA2 => 'diaspora',
Protocol::STATUSNET => 'gnu-social',
Protocol::ACTIVITYPUB => 'activitypub',