diff options
author | friendica <info@friendica.com> | 2014-08-28 16:56:13 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-08-28 16:56:13 -0700 |
commit | 53b5cf7f507df53d3e382b6714caacf9551ed6db (patch) | |
tree | 58a0ca038fc7db0f3a2218559bee219cf0b34fa1 /include/ConversationObject.php | |
parent | f526a10f07086ffeb5018b913916827a556f2fa1 (diff) | |
download | volse-hubzilla-53b5cf7f507df53d3e382b6714caacf9551ed6db.tar.gz volse-hubzilla-53b5cf7f507df53d3e382b6714caacf9551ed6db.tar.bz2 volse-hubzilla-53b5cf7f507df53d3e382b6714caacf9551ed6db.zip |
Ability to close comments at a certain date/time - needed for loom.io emulation (and many other uses)
Diffstat (limited to 'include/ConversationObject.php')
-rw-r--r-- | include/ConversationObject.php | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/include/ConversationObject.php b/include/ConversationObject.php index 9bf410358..767ef7360 100644 --- a/include/ConversationObject.php +++ b/include/ConversationObject.php @@ -159,28 +159,23 @@ 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(); |