} 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;
}
$filer = (($conv->getProfileOwner() == local_user()) ? t("save to folder") : false);
- $diff_author = ((link_compare($item['url'], $item['author-link'])) ? false : true);
+ $diff_author = !link_compare($item['url'], $item['author-link']);
$profile_name = htmlentities(((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']);
if ($item['author-link'] && (!$item['author-name'])) {
$profile_name = $item['author-link'];
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);
$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,
'$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']),