Optionally ignore some notice sources for public page

We optionally ignore some notice sources from the public page.
Typically these are automatic notice sources like twitterfeed that
don't usually represent the community on the site very well.
This commit is contained in:
Evan Prodromou 2009-02-14 21:55:25 -05:00
parent 32fc71b432
commit da2348fbbe
3 changed files with 13 additions and 2 deletions

View File

@ -136,10 +136,12 @@ class Notice extends Memcached_DataObject
$notice->profile_id = $profile_id; $notice->profile_id = $profile_id;
$blacklist = common_config('public', 'blacklist'); $blacklist = common_config('public', 'blacklist');
$autosource = common_config('public', 'autosource');
# Blacklisted are non-false, but not 1, either # Blacklisted are non-false, but not 1, either
if ($blacklist && in_array($profile_id, $blacklist)) { if (($blacklist && in_array($profile_id, $blacklist)) ||
($source && $autosource && in_array($source, $autosource))) {
$notice->is_local = -1; $notice->is_local = -1;
} else { } else {
$notice->is_local = $is_local; $notice->is_local = $is_local;

View File

@ -107,6 +107,14 @@ $config['sphinx']['port'] = 3312;
#$config['public']['blacklist'][] = 123; #$config['public']['blacklist'][] = 123;
#$config['public']['blacklist'][] = 2307; #$config['public']['blacklist'][] = 2307;
#Mark certain notice sources as automatic and thus not
#appropriate for public feed
#$config['public]['autosource'][] = 'twitterfeed';
#$config['public]['autosource'][] = 'rssdent';
#$config['public]['autosource'][] = 'Ping.Fm';
#$config['public]['autosource'][] = 'HelloTxt';
#$config['public]['autosource'][] = 'Updating.Me';
#Do notice broadcasts offline #Do notice broadcasts offline
#If you use this, you must run the six offline daemons in the #If you use this, you must run the six offline daemons in the
#background. See the README for details. #background. See the README for details.

View File

@ -106,7 +106,8 @@ $config =
array('server' => null), array('server' => null),
'public' => 'public' =>
array('localonly' => true, array('localonly' => true,
'blacklist' => array()), 'blacklist' => array(),
'autosource' => array()),
'theme' => 'theme' =>
array('server' => null), array('server' => null),
'throttle' => 'throttle' =>