]> git.mxchange.org Git - friendica.git/commitdiff
Remove block/ignore links from contact/item action menus for self
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 4 May 2021 12:45:27 +0000 (08:45 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 4 May 2021 12:45:27 +0000 (08:45 -0400)
include/conversation.php
src/Object/Post.php

index eae7fd72749bd8bf6b9f7e49e02991da34b142fa..0a8f5cfc313902de2cca66c3e961f0e9106a3823 100644 (file)
@@ -888,7 +888,8 @@ function conversation_fetch_items(array $parent, array $items, array $condition,
        return $items;
 }
 
-function item_photo_menu($item) {
+function item_photo_menu($item)
+{
        $sub_link = '';
        $poke_link = '';
        $contact_url = '';
@@ -929,8 +930,8 @@ function item_photo_menu($item) {
        if (!empty($pcid)) {
                $contact_url = 'contact/' . $pcid;
                $posts_link  = $contact_url . '/posts';
-               $block_link  = $contact_url . '/block';
-               $ignore_link = $contact_url . '/ignore';
+               $block_link  = $item['self'] ? '' : $contact_url . '/block';
+               $ignore_link = $item['self'] ? '' : $contact_url . '/ignore';
        }
 
        if ($cid && !$item['self']) {
@@ -983,7 +984,7 @@ function item_photo_menu($item) {
                if (strpos($v, 'javascript:') === 0) {
                        $v = substr($v, 11);
                        $o .= '<li role="menuitem"><a onclick="' . $v . '">' . $k . '</a></li>' . PHP_EOL;
-               } elseif ($v!='') {
+               } elseif ($v) {
                        $o .= '<li role="menuitem"><a href="' . $v . '">' . $k . '</a></li>' . PHP_EOL;
                }
        }
index 45b53112bcb6feec5209e1124b974e8c3898eaac..6973fd236a3064c92b1fd0102a731a0128566c56 100644 (file)
@@ -223,9 +223,12 @@ class Post
                        $drop = [
                                'dropping' => $dropping,
                                'pagedrop' => $item['pagedrop'],
-                               'select'   => DI::l10n()->t('Select'),
-                               'delete'   => $delete,
+                               'select' => DI::l10n()->t('Select'),
+                               'delete' => $delete,
                        ];
+               }
+
+               if (!$item['self']) {
                        $block = [
                                'blocking' => true,
                                'block'   => DI::l10n()->t('Block %s', $item['author-name']),