mirror of
https://github.com/friendica/friendica
synced 2025-04-27 19:50:12 +00:00
Best "uid" for sending comments, refresh after commenting might work now
This commit is contained in:
parent
708d034c6d
commit
e12b6e01a2
6 changed files with 16 additions and 8 deletions
|
@ -765,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,
|
||||
|
@ -774,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']),
|
||||
|
|
|
@ -67,7 +67,7 @@ class Thread extends BaseObject
|
|||
$this->writable = can_write_wall($this->profile_owner) || $writable;
|
||||
break;
|
||||
case 'community':
|
||||
$this->profile_owner = local_user();
|
||||
$this->profile_owner = 0;
|
||||
$this->writable = $writable;
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue