aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-06-16 19:14:01 -0700
committerfriendica <info@friendica.com>2013-06-16 19:14:01 -0700
commit764ee785f5505c2be804a850b8e4029598d81739 (patch)
tree236e56e5549ce14272f39939c17c581ce365764e /include
parent99252d65bfd59fb704d32f7dde4c62b080303d33 (diff)
downloadvolse-hubzilla-764ee785f5505c2be804a850b8e4029598d81739.tar.gz
volse-hubzilla-764ee785f5505c2be804a850b8e4029598d81739.tar.bz2
volse-hubzilla-764ee785f5505c2be804a850b8e4029598d81739.zip
We will need a per item comment policy to be able to determine in advance if we have permission to comment on something , and we'll need to send it out with all communications. The current check is not only flawed but also a huge performance hit. Also provide the ability for an item to disable commenting completely - such as for a webpage or wherever you want to prevent comments on one item, without requiring a change to your entire permission scheme. All of this is only partially implemented at the moment but we need the structures in place on several sites in order to finish it without breaking everything.
Diffstat (limited to 'include')
-rwxr-xr-xinclude/items.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/items.php b/include/items.php
index 64eeae4b4..9d93accfe 100755
--- a/include/items.php
+++ b/include/items.php
@@ -549,13 +549,17 @@ function encode_item($item) {
intval($item['uid'])
);
- if($r)
+ if($r) {
$public_scope = $r[0]['channel_r_stream'];
- else
+ $comment_scope = $r[0]['channel_w_comment'];
+ }
+ else {
$public_scope = 0;
+ $comment_scope = 0;
+ }
$scope = map_scope($public_scope);
-
+ $c_scope = map_scope($comment_scope);
if($item['item_restrict'] & ITEM_DELETED) {
$x['message_id'] = $item['mid'];
@@ -597,6 +601,11 @@ function encode_item($item) {
if(! in_array('private',$y))
$x['public_scope'] = $scope;
+ if($item['item_flags'] & ITEM_NOCOMMENT)
+ $x['comment_scope'] = 'none';
+ else
+ $x['comment_scope'] = $c_scope;
+
if($item['term'])
$x['tags'] = encode_item_terms($item['term']);