X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FObject%2FPost.php;h=97768bf56cd79c663d821e3f49da7c1ea89623cb;hb=390d5706f46ce58cbed24b292d5c1f1b9789a8a8;hp=dd32fc3e3ee18ccff7d41573a611f9fb3f7b1fa6;hpb=9a3e773a9a0464a309e4891f40c1105c8e2fed33;p=friendica.git diff --git a/src/Object/Post.php b/src/Object/Post.php index dd32fc3e3e..97768bf56c 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -151,10 +151,18 @@ class Post extends BaseObject } else { $edpost = array("editpost/" . $item['id'], t("Edit")); } + $dropping = in_array($item['uid'], [0, local_user()]); } else { $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; } @@ -285,6 +293,12 @@ class Post extends BaseObject if ($shareable) { $buttons['share'] = array(t('Share this'), t('share')); } + + // If a contact isn't writable, we cannot send a like or dislike to it + if (!$item['writable']) { + unset($buttons["like"]); + unset($buttons["dislike"]); + } } $comment = $this->getCommentBox($indent); @@ -751,6 +765,14 @@ class Post extends BaseObject $qcomment = (($qc) ? explode("\n", $qc) : null); } + // Fetch the user id from the parent when the owner user is empty + $uid = $conv->getProfileOwner(); + $parent_uid = $this->getDataValue('uid'); + + if (!empty($parent_uid) && empty($uid) && ($uid != $parent_uid)) { + $uid = $parent_uid; + } + $template = get_markup_template($this->getCommentBoxTemplate()); $comment_box = replace_macros($template, array( '$return_path' => $a->query_string, @@ -760,7 +782,7 @@ class Post extends BaseObject '$id' => $this->getId(), '$parent' => $this->getId(), '$qcomment' => $qcomment, - '$profile_uid' => $conv->getProfileOwner(), + '$profile_uid' => $uid, '$mylink' => $a->remove_baseurl($a->contact['url']), '$mytitle' => t('This is you'), '$myphoto' => $a->remove_baseurl($a->contact['thumb']),