]> git.mxchange.org Git - friendica.git/commitdiff
Disable editing of public items / Reshare of community items is now possible
authorMichael <heluecht@pirati.ca>
Fri, 5 Jan 2018 13:48:06 +0000 (13:48 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 5 Jan 2018 13:48:06 +0000 (13:48 +0000)
mod/community.php
src/Object/Post.php

index a75a3cf7dd449d06dd63b26cf99d40f80cb2dd02..acd36331b206bdc3c53d3e0a5b3605ce6b6579a7 100644 (file)
@@ -81,6 +81,22 @@ function community_content(App $a, $update = 0) {
                $o .= replace_macros($tab_tpl, array('$tabs' => $tabs));
 
                nav_set_selected('community');
+
+               // We need the editor here to be able to reshare an item.
+               if (local_user()) {
+                       $x = array(
+                               'is_owner' => true,
+                               'allow_location' => $a->user['allow_location'],
+                               'default_location' => $a->user['default-location'],
+                               'nickname' => $a->user['nickname'],
+                               'lockstate' => (is_array($a->user) && (strlen($a->user['allow_cid']) || strlen($a->user['allow_gid']) || strlen($a->user['deny_cid']) || strlen($a->user['deny_gid'])) ? 'lock' : 'unlock'),
+                               'acl' => populate_acl($a->user, true),
+                               'bang' => '',
+                               'visitor' => 'block',
+                               'profile_uid' => local_user(),
+                       );
+                       $o .= status_editor($a, $x, 0, true);
+               }
        }
 
        if (Config::get('system', 'comment_public')) {
index 7ffbe6e726f8236162ed671ca564331cbb949364..ebeaccb7edf5095920f787fe0c5f8de119846579 100644 (file)
@@ -155,6 +155,13 @@ class Post extends BaseObject
                        $edpost = false;
                }
 
+               // Editing on items of not subscribed users isn't currently possible
+               // There are some issues on editing that prevent this.
+               // But also it is an issue of the supported protocols that doesn't allow editing at all.
+               if ($item['uid'] == 0) {
+                       $edpost = false;
+               }
+
                if (($this->getDataValue('uid') == local_user()) || $this->isVisiting()) {
                        $dropping = true;
                }