diff options
author | mrjive <mrjive@mrjive.it> | 2015-01-06 15:13:03 +0100 |
---|---|---|
committer | mrjive <mrjive@mrjive.it> | 2015-01-06 15:13:03 +0100 |
commit | b80c218606994032e76805900cb9b340ea132358 (patch) | |
tree | bf625cf4c59bf521e639018399bf1770d116a6a0 /include/ConversationObject.php | |
parent | aa6d61d3b19cb13c30bf5a1579adefedf0cc9515 (diff) | |
parent | 3185bfe3ca131d471b8fcdc0c94abf1a114486c7 (diff) | |
download | volse-hubzilla-b80c218606994032e76805900cb9b340ea132358.tar.gz volse-hubzilla-b80c218606994032e76805900cb9b340ea132358.tar.bz2 volse-hubzilla-b80c218606994032e76805900cb9b340ea132358.zip |
Merge pull request #1 from friendica/master
test pull request
Diffstat (limited to 'include/ConversationObject.php')
-rw-r--r-- | include/ConversationObject.php | 49 |
1 files changed, 22 insertions, 27 deletions
diff --git a/include/ConversationObject.php b/include/ConversationObject.php index 9bf410358..a02ba102f 100644 --- a/include/ConversationObject.php +++ b/include/ConversationObject.php @@ -52,14 +52,14 @@ class Conversation extends BaseObject { switch($mode) { case 'network': - if(array_key_exists('firehose',$a->data) && intval($a->data['firehose'])) { - $this->profile_owner = intval($a->data['firehose']); - $this->writable = false; - } - else { +// if(array_key_exists('firehose',$a->data) && intval($a->data['firehose'])) { +// $this->profile_owner = intval($a->data['firehose']); +// $this->writable = false; +// } +// else { $this->profile_owner = local_user(); $this->writable = true; - } +// } break; case 'channel': $this->profile_owner = $a->profile['profile_uid']; @@ -159,34 +159,29 @@ class Conversation extends BaseObject { return false; } -// if(local_user() && $item->get_data_value('uid') == local_user()) -// $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(! comments_are_now_closed($item->get_data())) { + 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) { - $item->set_commentable(false); - } - 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)); + if($item->get_data_value('item_flags') & ITEM_NOCOMMENT) { + $item->set_commentable(false); + } + 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)); + } } - require_once('include/identity.php'); - $sys = get_sys_channel(); +// $sys = get_sys_channel(); - if($sys && $item->get_data_value('uid') == $sys['channel_id']) { - $item->set_commentable(false); - } +// if($sys && $item->get_data_value('uid') == $sys['channel_id']) { +// $item->set_commentable(false); +// } $item->set_conversation($this); $this->threads[] = $item; |