Remove some dead code and associated defines.

This commit is contained in:
Mike Macgirvin 2022-06-21 16:13:01 -07:00
parent 17e14ec33a
commit 0923449a21
6 changed files with 6 additions and 86 deletions

View file

@ -39,7 +39,7 @@ class Libacl
$showall_caption = t('Visible to your default audience');
} elseif (is_a($emptyACL_description, '\\Code\\Lib\\PermissionDescription')) {
$showall_caption = $emptyACL_description->get_permission_description();
$showall_origin = (($role === 'custom') ? $emptyACL_description->get_permission_origin_description() : '');
$showall_origin = '';
$showall_icon = $emptyACL_description->get_permission_icon();
} else {
// For backwards compatibility we still accept a string... for now!

View file

@ -159,30 +159,4 @@ class PermissionDescription
return '';
}
}
/**
* Returns a localized description of where the permission came from, if this is known.
* If it's not know, or if the permission is standalone and didn't come from a default
* permission setting, then empty string is returned.
*
* @return string description or empty string
*/
public function get_permission_origin_description()
{
switch ($this->global_perm) {
case PERMS_R_STREAM:
return t('This is your default setting for the audience of your normal stream, and posts.');
case PERMS_R_PROFILE:
return t('This is your default setting for who can view your default channel profile');
case PERMS_R_ABOOK:
return t('This is your default setting for who can view your connections');
case PERMS_R_STORAGE:
return t('This is your default setting for who can view your file storage and photos');
case PERMS_R_PAGES:
return t('This is your default setting for the audience of your webpages');
default:
return '';
}
}
}

View file

@ -977,8 +977,7 @@ class Profiles extends Controller
$i = $res['item_id'];
if ($i) {
// FIXME - limit delivery in notifier.php to those specificed in the perms argument
Run::Summon(['Notifier', 'activity', $i, 'PERMS_R_PROFILE']);
Run::Summon(['Notifier', 'wall-new', $i]);
}
}

View file

@ -267,52 +267,19 @@ define ( 'MENU_BOOKMARK', 0x0002 );
* Network and protocol family types
*/
define ( 'NETWORK_FRND', 'friendica-over-diaspora'); // Friendica, Mistpark, other DFRN implementations
define ( 'NETWORK_DFRN', 'dfrn'); // Friendica, Mistpark, other DFRN implementations
define ( 'NETWORK_ZOT', 'zot'); // Zot!
define ( 'NETWORK_ZOT6', 'zot6');
define ( 'NETWORK_NOMAD', 'nomad');
define ( 'NETWORK_OSTATUS', 'stat'); // status.net, identi.ca, GNU-social, other OStatus implementations
define ( 'NETWORK_GNUSOCIAL', 'gnusoc'); // status.net, identi.ca, GNU-social, other OStatus implementations
define ( 'NETWORK_FEED', 'rss'); // RSS/Atom feeds with no known "post/notify" protocol
define ( 'NETWORK_DIASPORA', 'diaspora'); // Diaspora
define ( 'NETWORK_ACTIVITYPUB', 'activitypub');
define ( 'NETWORK_MAIL', 'mail'); // IMAP/POP
define ( 'NETWORK_MAIL2', 'mai2'); // extended IMAP/POP
define ( 'NETWORK_FACEBOOK', 'face'); // Facebook API
define ( 'NETWORK_LINKEDIN', 'lnkd'); // LinkedIn
define ( 'NETWORK_XMPP', 'xmpp'); // XMPP
define ( 'NETWORK_MYSPACE', 'mysp'); // MySpace
define ( 'NETWORK_GPLUS', 'goog'); // Google+
define ( 'NETWORK_PHANTOM', 'unkn'); // Place holder
/**
* Permissions
*/
define ( 'PERMS_R_STREAM', 0x00001);
define ( 'PERMS_R_PROFILE', 0x00002);
define ( 'PERMS_R_PHOTOS', 0x00004);
define ( 'PERMS_R_ABOOK', 0x00008);
define ( 'PERMS_W_STREAM', 0x00010);
define ( 'PERMS_W_WALL', 0x00020);
define ( 'PERMS_W_TAGWALL', 0x00040);
define ( 'PERMS_W_COMMENT', 0x00080);
define ( 'PERMS_W_MAIL', 0x00100);
define ( 'PERMS_W_PHOTOS', 0x00200);
define ( 'PERMS_W_CHAT', 0x00400);
define ( 'PERMS_A_DELEGATE', 0x00800);
define ( 'PERMS_R_STORAGE', 0x01000);
define ( 'PERMS_W_STORAGE', 0x02000);
define ( 'PERMS_R_PAGES', 0x04000);
define ( 'PERMS_W_PAGES', 0x08000);
define ( 'PERMS_A_REPUBLISH', 0x10000);
define ( 'PERMS_W_LIKE', 0x20000);
// General channel permissions
// 0 = Only you
define ( 'PERMS_PUBLIC' , 0x0001 ); // anybody
define ( 'PERMS_NETWORK' , 0x0002 ); // anybody in this network

View file

@ -828,12 +828,7 @@ function best_link_url($item)
if ((local_channel()) && (local_channel() == $item['uid'])) {
if (isset(App::$contacts) && x(App::$contacts, $clean_url)) {
if (App::$contacts[$clean_url]['network'] === NETWORK_DFRN) {
$best_url = z_root() . '/redir/' . App::$contacts[$clean_url]['id'];
$sparkle = true;
} else {
$best_url = App::$contacts[$clean_url]['url'];
}
$best_url = App::$contacts[$clean_url]['url'];
}
}
if (! $best_url) {

View file

@ -1725,12 +1725,7 @@ function deliverable_singleton($channel_id, $xchan)
function get_repository_version($branch = 'release')
{
if (PLATFORM_NAME === 'streams') {
$path = "https://raw.codeberg.page/streams/" . PLATFORM_NAME . "/@$branch/version.php";
}
else {
$path = "https://raw.codeberg.page/zot/" . ((PLATFORM_NAME === 'mistpark') ? 'misty' : PLATFORM_NAME) . "/@$branch/version.php";
}
$path = "https://raw.codeberg.page/streams/" . PLATFORM_NAME . "/@$branch/version.php";
$x = z_fetch_url($path);
if ($x['success']) {
@ -1752,21 +1747,11 @@ function network_to_name($s)
{
$nets = array(
NETWORK_DFRN => t('Friendica'),
NETWORK_FRND => t('Friendica'),
NETWORK_OSTATUS => t('OStatus'),
NETWORK_GNUSOCIAL => t('GNU-Social'),
NETWORK_FEED => t('RSS/Atom'),
NETWORK_ACTIVITYPUB => t('ActivityPub'),
NETWORK_MAIL => t('Email'),
NETWORK_DIASPORA => t('Diaspora'),
NETWORK_FACEBOOK => t('Facebook'),
NETWORK_NOMAD => t('Nomad'),
NETWORK_ZOT6 => t('Nomad'),
NETWORK_ZOT => t('Zot'),
NETWORK_LINKEDIN => t('LinkedIn'),
NETWORK_XMPP => t('XMPP/IM'),
NETWORK_MYSPACE => t('MySpace'),
NETWORK_NOMAD => t('Nomad'),
NETWORK_ZOT6 => t('Zot6'),
);
/**