aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-06-13 22:09:22 -0700
committerredmatrix <git@macgirvin.com>2016-06-13 22:09:22 -0700
commit0ef2622621867fa197988974b47eff85f20a80e7 (patch)
tree671f4e55a9094f80b4d492b953e13fcdc3f9399e
parent1ff9abe1b4b5570c790ed6956f4e5eda58587379 (diff)
downloadvolse-hubzilla-0ef2622621867fa197988974b47eff85f20a80e7.tar.gz
volse-hubzilla-0ef2622621867fa197988974b47eff85f20a80e7.tar.bz2
volse-hubzilla-0ef2622621867fa197988974b47eff85f20a80e7.zip
some work to provide propagation and honouring of the item_notshown flag.
-rw-r--r--Zotlabs/Module/Wiki.php4
-rw-r--r--include/conversation.php7
-rwxr-xr-xinclude/items.php24
3 files changed, 25 insertions, 10 deletions
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php
index 1e6446904..f1f7b87b2 100644
--- a/Zotlabs/Module/Wiki.php
+++ b/Zotlabs/Module/Wiki.php
@@ -1,6 +1,6 @@
-<?php
+<?php /** @file */
-namespace Zotlabs\Module;/** @file */
+namespace Zotlabs\Module;
class Wiki extends \Zotlabs\Web\Controller {
diff --git a/include/conversation.php b/include/conversation.php
index bf29048b6..d2d4ffca0 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -403,9 +403,12 @@ function count_descendants($item) {
* @return boolean
*/
function visible_activity($item) {
- $hidden_activities = array(ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_AGREE, ACTIVITY_DISAGREE, ACTIVITY_ABSTAIN, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE);
+ $hidden_activities = [ ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_AGREE, ACTIVITY_DISAGREE, ACTIVITY_ABSTAIN, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE ];
- $post_types = array(ACTIVITY_OBJ_NOTE,ACTIVITY_OBJ_COMMENT,basename(ACTIVITY_OBJ_NOTE),basename(ACTIVITY_OBJ_COMMENT));
+ $post_types = [ ACTIVITY_OBJ_NOTE, ACTIVITY_OBJ_COMMENT, basename(ACTIVITY_OBJ_NOTE), basename(ACTIVITY_OBJ_COMMENT)];
+
+ if(intval($item['item_notshown']))
+ return false;
foreach ($hidden_activities as $act) {
if ((activity_match($item['verb'], $act)) && ($item['mid'] != $item['parent_mid'])) {
diff --git a/include/items.php b/include/items.php
index 913ff1573..a844cd1f6 100755
--- a/include/items.php
+++ b/include/items.php
@@ -677,13 +677,23 @@ function get_item_elements($x,$allow_code = false) {
$arr['item_flags'] = 0;
- if(array_key_exists('flags',$x) && in_array('consensus',$x['flags']))
- $arr['item_consensus'] = 1;
+ if(array_key_exists('flags',$x)) {
- if(array_key_exists('flags',$x) && in_array('deleted',$x['flags']))
- $arr['item_deleted'] = 1;
- if(array_key_exists('flags',$x) && in_array('hidden',$x['flags']))
- $arr['item_hidden'] = 1;
+ if(in_array('consensus',$x['flags']))
+ $arr['item_consensus'] = 1;
+
+ if(in_array('deleted',$x['flags']))
+ $arr['item_deleted'] = 1;
+
+ if(in_array('notshown',$x['flags']))
+ $arr['item_notshown'] = 1;
+
+ // hidden item are no longer propagated - notshown may be a suitable alternative
+
+ if(in_array('hidden',$x['flags']))
+ $arr['item_hidden'] = 1;
+
+ }
// Here's the deal - the site might be down or whatever but if there's a new person you've never
// seen before sending stuff to your stream, we MUST be able to look them up and import their data from their
@@ -1339,6 +1349,8 @@ function encode_item_flags($item) {
$ret[] = 'deleted';
if(intval($item['item_hidden']))
$ret[] = 'hidden';
+ if(intval($item['item_notshown']))
+ $ret[] = 'notshown';
if(intval($item['item_thread_top']))
$ret[] = 'thread_parent';
if(intval($item['item_nsfw']))