]> git.mxchange.org Git - friendica.git/commitdiff
Show "Remove from your screen" or "delete" depending of the impact of the deletion
authorMichael <heluecht@pirati.ca>
Tue, 15 May 2018 21:06:34 +0000 (21:06 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 15 May 2018 21:06:34 +0000 (21:06 +0000)
include/conversation.php
src/Object/Post.php

index 5d84be74cab81ed63cb9b95d322e672ceee4763b..324b53b5a880410584f5695a48b15c4798f17188 100644 (file)
@@ -433,7 +433,6 @@ These Fields are not added below (yet). They are here to for bug search.
 `item`.`bookmark`,
 `item`.`unseen`,
 `item`.`deleted`,
-`item`.`origin`,
 `item`.`forum_mode`,
 `item`.`mention`,
 `item`.`global`,
@@ -446,7 +445,7 @@ These Fields are not added below (yet). They are here to for bug search.
                `item`.`uri`, `item`.`thr-parent`, `item`.`parent-uri`, `item`.`content-warning`,
                `item`.`commented`, `item`.`created`, `item`.`edited`, `item`.`received`,
                `item`.`verb`, `item`.`object-type`, `item`.`postopts`, `item`.`plink`,
-               `item`.`guid`, `item`.`wall`, `item`.`private`, `item`.`starred`,
+               `item`.`guid`, `item`.`wall`, `item`.`private`, `item`.`starred`, `item`.`origin`,
                `item`.`title`, `item`.`body`, `item`.`file`, `item`.`event-id`,
                `item`.`location`, `item`.`coord`, `item`.`app`, `item`.`attach`,
                `item`.`rendered-hash`, `item`.`rendered-html`, `item`.`object`,
index 63ab67698840889b43237dc93908f9226922e022..b47bbd69fe866556f3016785ab724d097e51d244 100644 (file)
@@ -172,13 +172,31 @@ class Post extends BaseObject
                        $dropping = true;
                }
 
+               $origin = $item['origin'];
+
+               if (!$origin) {
+                       /// @todo This shouldn't be done as query here, but better during the data creation.
+                       // it is now done here, since during the RC phase we shouldn't make to intense changes.
+                       $parent = dba::selectFirst('item', ['origin'], ['id' => $item['parent']]);
+                       if (DBM::is_result($parent)) {
+                               $origin = $parent['origin'];
+                       }
+               }
+
+               // Showing the one or the other text, depending upon if we can only hide it or really delete it.
+               $delete = $origin ? L10n::t('Delete') : L10n::t('Remove from your stream');
+
                $drop = [
                        'dropping' => $dropping,
                        'pagedrop' => ((Feature::isEnabled($conv->getProfileOwner(), 'multi_delete')) ? $item['pagedrop'] : ''),
                        'select'   => L10n::t('Select'),
-                       'delete'   => L10n::t('Remove from your stream'),
+                       'delete'   => $delete,
                ];
 
+               if (!local_user()) {
+                       $drop = false;
+               }
+
                $filer = (($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) ? L10n::t("save to folder") : false);
 
                $diff_author = !link_compare($item['url'], $item['author-link']);