mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
more work on enhanced content filters
This commit is contained in:
@@ -2003,7 +2003,10 @@ class Activity {
|
||||
}
|
||||
|
||||
if ($channel['channel_system']) {
|
||||
if (!MessageFilter::evaluate($s, get_config('system', 'pubstream_incl'), get_config('system', 'pubstream_excl'))) {
|
||||
$incl = get_config('system','pubstream_incl');
|
||||
$excl = get_config('system','pubstream_excl');
|
||||
|
||||
if(($incl || $excl) && !MessageFilter::evaluate($s, $incl, $excl)) {
|
||||
logger('post is filtered');
|
||||
return;
|
||||
}
|
||||
@@ -2329,6 +2332,32 @@ class Activity {
|
||||
}
|
||||
}
|
||||
|
||||
$s['item_thread_top'] = 0;
|
||||
$s['comment_policy'] = 'authenticated';
|
||||
|
||||
if ($s['mid'] === $s['parent_mid']) {
|
||||
$s['item_thread_top'] = 1;
|
||||
|
||||
// it is a parent node - decode the comment policy info if present
|
||||
if (isset($act->obj['commentPolicy'])) {
|
||||
$until = strpos($act->obj['commentPolicy'], 'until=');
|
||||
if ($until !== false) {
|
||||
$s['comments_closed'] = datetime_convert('UTC', 'UTC', substr($act->obj['commentPolicy'], $until + 6));
|
||||
if ($s['comments_closed'] < datetime_convert()) {
|
||||
$s['nocomment'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
$remainder = substr($act->obj['commentPolicy'], 0, (($until) ? $until : strlen($act->obj['commentPolicy'])));
|
||||
if ($remainder) {
|
||||
$s['comment_policy'] = $remainder;
|
||||
}
|
||||
if (!(isset($item['comment_policy']) && strlen($item['comment_policy']))) {
|
||||
$s['comment_policy'] = 'contacts';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!array_key_exists('created', $s))
|
||||
$s['created'] = datetime_convert();
|
||||
|
||||
@@ -2955,7 +2984,10 @@ class Activity {
|
||||
return;
|
||||
|
||||
if ($channel['channel_system']) {
|
||||
if (!MessageFilter::evaluate($item, get_config('system', 'pubstream_incl'), get_config('system', 'pubstream_excl'))) {
|
||||
$incl = get_config('system','pubstream_incl');
|
||||
$excl = get_config('system','pubstream_excl');
|
||||
|
||||
if(($incl || $excl) && !MessageFilter::evaluate($item, $incl, $excl)) {
|
||||
logger('post is filtered');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1578,7 +1578,11 @@ class Libzot {
|
||||
$local_public = false;
|
||||
continue;
|
||||
}
|
||||
if (!MessageFilter::evaluate($arr, get_config('system', 'pubstream_incl'), get_config('system', 'pubstream_excl'))) {
|
||||
|
||||
$incl = get_config('system','pubstream_incl');
|
||||
$excl = get_config('system','pubstream_excl');
|
||||
|
||||
if(($incl || $excl) && !MessageFilter::evaluate($arr, $incl, $excl)) {
|
||||
$local_public = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user