diff options
author | Paolo T <tuscanhobbit@users.noreply.github.com> | 2013-10-11 00:24:25 -0700 |
---|---|---|
committer | Paolo T <tuscanhobbit@users.noreply.github.com> | 2013-10-11 00:24:25 -0700 |
commit | 7a63d5e50b0ae16a38e673867abd6043d4becc07 (patch) | |
tree | 6d174d12a0de707ed8f875801a8dbc0c35f70d3f /include/ConversationObject.php | |
parent | c2a88c3e4858e3eb2c553bdc775d2f684b0d46b4 (diff) | |
parent | 89fc319c900873be58fa677707518646f6c79eec (diff) | |
download | volse-hubzilla-7a63d5e50b0ae16a38e673867abd6043d4becc07.tar.gz volse-hubzilla-7a63d5e50b0ae16a38e673867abd6043d4becc07.tar.bz2 volse-hubzilla-7a63d5e50b0ae16a38e673867abd6043d4becc07.zip |
Merge pull request #2 from friendica/master
Upgraded to latest red
Diffstat (limited to 'include/ConversationObject.php')
-rw-r--r-- | include/ConversationObject.php | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/include/ConversationObject.php b/include/ConversationObject.php index 30026e908..bb144d893 100644 --- a/include/ConversationObject.php +++ b/include/ConversationObject.php @@ -7,6 +7,7 @@ require_once('boot.php'); require_once('include/BaseObject.php'); require_once('include/ItemObject.php'); require_once('include/text.php'); +require_once('include/items.php'); /** * A list of threads @@ -138,22 +139,28 @@ 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())) { + if((array_key_exists('owner',$item->data)) && ($item->data['owner']['abook_flags'] & ABOOK_FLAG_SELF)) + $item->set_commentable(perm_is_allowed($this->profile_owner,$this->observer['xchan_hash'],'post_comments')); + else + $item->set_commentable(can_comment_on_post($this->observer['xchan_hash'],$item->data)); } - - - $item->set_conversation($this); $this->threads[] = $item; return end($this->threads); |