From 0923449a2134ab2785ea78f1a79b5a0d67e27b50 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Tue, 21 Jun 2022 16:13:01 -0700 Subject: [PATCH] Remove some dead code and associated defines. --- Code/Lib/Libacl.php | 2 +- Code/Lib/PermissionDescription.php | 26 ----------------------- Code/Module/Profiles.php | 3 +-- boot.php | 33 ------------------------------ include/conversation.php | 7 +------ include/network.php | 21 +++---------------- 6 files changed, 6 insertions(+), 86 deletions(-) diff --git a/Code/Lib/Libacl.php b/Code/Lib/Libacl.php index a6bf7f197..9bda99bc5 100644 --- a/Code/Lib/Libacl.php +++ b/Code/Lib/Libacl.php @@ -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! diff --git a/Code/Lib/PermissionDescription.php b/Code/Lib/PermissionDescription.php index 8bc03690c..aa1ccb3d0 100644 --- a/Code/Lib/PermissionDescription.php +++ b/Code/Lib/PermissionDescription.php @@ -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 ''; - } - } } diff --git a/Code/Module/Profiles.php b/Code/Module/Profiles.php index ea279a5ca..10548f373 100644 --- a/Code/Module/Profiles.php +++ b/Code/Module/Profiles.php @@ -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]); } } diff --git a/boot.php b/boot.php index 1c03e5a7c..7e79ebd1d 100755 --- a/boot.php +++ b/boot.php @@ -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 diff --git a/include/conversation.php b/include/conversation.php index efb2ef7a6..8eacf3a0e 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -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) { diff --git a/include/network.php b/include/network.php index 690d83c7b..98c1e7a61 100644 --- a/include/network.php +++ b/include/network.php @@ -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'), ); /**