is_commentable() had some major issues when applied to the atrocity known as ConversationObject, hopefully this won't destabilise the network as it's a somewhat major permission tweak related to comments; also add any local clones to allowed_public_recips() as they should always be allowed recipients. Not sure what to do about host permissions in the event of clones. They have more than one host, and it isn't spelled out in the sent message.

All of this stuff will make your head hurt.
This commit is contained in:
friendica
2013-09-20 05:45:11 -07:00
parent a44e15dc2c
commit e6d93b2516
3 changed files with 30 additions and 12 deletions

View File

@@ -138,22 +138,25 @@ class Conversation extends BaseObject {
return false;
}
if(local_user() && $item->get_data_value('uid') == local_user())
$this->commentable = true;
// if(local_user() && $item->get_data_value('uid') == local_user())
// $this->commentable = true;
if($this->writable)
$this->commentable = true;
// if($this->writable)
// $this->commentable = true;
$item->set_commentable(false);
$ob_hash = (($this->observer) ? $this->observer['xchan_hash'] : '');
if(($item->get_data_value('author_xchan') === $ob_hash) || ($item->get_data_value('owner_xchan') === $ob_hash))
$item->set_commentable(true);
if($item->get_data_value('item_flags') & ITEM_NOCOMMENT) {
$this->commentable = false;
$item->set_commentable(false);
}
elseif(($this->observer) && (! $this->writable)) {
$this->commentable = can_comment_on_post($this->observer['xchan_hash'],$item->data);
elseif(($this->observer) && (! $item->is_commentable())) {
$item->set_commentable(can_comment_on_post($this->observer['xchan_hash'],$item->data));
}
$item->set_conversation($this);
$this->threads[] = $item;
return end($this->threads);