From: Michael Date: Thu, 15 Nov 2018 06:36:06 +0000 (+0000) Subject: Improved delete text to clarify AP comment delete behaviour X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6ad082a710ee809ce03321e679c7b10f4adf6fe6;p=friendica.git Improved delete text to clarify AP comment delete behaviour --- diff --git a/src/Model/Item.php b/src/Model/Item.php index 30c29e1518..4a29e51d31 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1011,10 +1011,8 @@ class Item extends BaseObject $matches = false; $cnt = preg_match_all('/<(.*?)>/', $item['file'], $matches, PREG_SET_ORDER); - if ($cnt) - { - foreach ($matches as $mtch) - { + if ($cnt) { + foreach ($matches as $mtch) { FileTag::unsaveFile($item['uid'], $item['id'], $mtch[1],true); } } @@ -1023,10 +1021,8 @@ class Item extends BaseObject $cnt = preg_match_all('/\[(.*?)\]/', $item['file'], $matches, PREG_SET_ORDER); - if ($cnt) - { - foreach ($matches as $mtch) - { + if ($cnt) { + foreach ($matches as $mtch) { FileTag::unsaveFile($item['uid'], $item['id'], $mtch[1],false); } } diff --git a/src/Object/Post.php b/src/Object/Post.php index 2201683437..17912b96d5 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -190,8 +190,13 @@ class Post extends BaseObject } } - // Showing the one or the other text, depending upon if we can only hide it or really delete it. - $delete = $origin ? L10n::t('Delete globally') : L10n::t('Remove locally'); + if ($origin && ($item['id'] != $item['parent']) && ($item['network'] == Protocol::ACTIVITYPUB)) { + // ActivityPub doesn't allow removal of remote comments + $delete = L10n::t('Delete locally'); + } else { + // Showing the one or the other text, depending upon if we can only hide it or really delete it. + $delete = $origin ? L10n::t('Delete globally') : L10n::t('Remove locally'); + } $drop = [ 'dropping' => $dropping,