summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-02-14 21:55:25 -0500
committerEvan Prodromou <evan@controlyourself.ca>2009-02-14 21:55:25 -0500
commitda2348fbbe27facf4cfbf3fad800b3ccf98b4136 (patch)
treeb309359f0556b51bcef8fde39dfcc82d55dfa969
parent32fc71b43240e620e667354b97c662ac5ef1dab5 (diff)
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.
-rw-r--r--classes/Notice.php4
-rw-r--r--config.php.sample8
-rw-r--r--lib/common.php3
3 files changed, 13 insertions, 2 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 6db59c96e..b8cd2bd7f 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -136,10 +136,12 @@ class Notice extends Memcached_DataObject
$notice->profile_id = $profile_id;
$blacklist = common_config('public', 'blacklist');
+ $autosource = common_config('public', 'autosource');
# 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;
} else {
$notice->is_local = $is_local;
diff --git a/config.php.sample b/config.php.sample
index a2c5801f4..3fa898e1b 100644
--- a/config.php.sample
+++ b/config.php.sample
@@ -107,6 +107,14 @@ $config['sphinx']['port'] = 3312;
#$config['public']['blacklist'][] = 123;
#$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
#If you use this, you must run the six offline daemons in the
#background. See the README for details.
diff --git a/lib/common.php b/lib/common.php
index 7bfd14c42..4fc749ca0 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -106,7 +106,8 @@ $config =
array('server' => null),
'public' =>
array('localonly' => true,
- 'blacklist' => array()),
+ 'blacklist' => array(),
+ 'autosource' => array()),
'theme' =>
array('server' => null),
'throttle' =>