]> git.mxchange.org Git - friendica.git/commitdiff
Improved delete text to clarify AP comment delete behaviour
authorMichael <heluecht@pirati.ca>
Thu, 15 Nov 2018 06:36:06 +0000 (06:36 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 15 Nov 2018 06:36:06 +0000 (06:36 +0000)
src/Model/Item.php
src/Object/Post.php

index 30c29e1518b18cea736de93613f6a9c9657abd3a..4a29e51d31a2fe3cce3728b65c3a5fffea91fbbc 100644 (file)
@@ -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);
                        }
                }
index 22016834375b19da3377aef636db75bb01e758a9..17912b96d535f0fedeb205c8e81d0c53b8b75fda 100644 (file)
@@ -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,