hide certain users from the public stream
On identi.ca, certain users (http://identi.ca/derricklo) publish 5-10 automated notices every half hour or hour. This can flood the public stream, making it unreadable for casual readers. We don't want to prevent anyone from using the site for personal use. However, if their personal use clouds up the public space, we can gently remove them from that public space without interfering with their personal activity. So: this change prevents selected people's notices from appearing in the public stream. It's hand-configured by an administrator, and probably doesn't scale beyond 10-20 blacklisted users. It's a stopgap measure. darcs-hash:20081120183722-84dde-8a8401fbcbb6abb60a8b36de249323586ea0b22c.gz
This commit is contained in:
parent
7877e86506
commit
35407614bb
|
@ -357,17 +357,22 @@ class Notice extends Memcached_DataObject
|
||||||
|
|
||||||
function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0) {
|
function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0) {
|
||||||
|
|
||||||
$needAnd = FALSE;
|
$parts = array();
|
||||||
$needWhere = TRUE;
|
|
||||||
|
|
||||||
$qry = 'SELECT * FROM notice ';
|
$qry = 'SELECT * FROM notice ';
|
||||||
|
|
||||||
if (common_config('public', 'localonly')) {
|
if (common_config('public', 'localonly')) {
|
||||||
$qry .= ' WHERE is_local = 1 ';
|
$parts[] = 'is_local = 1';
|
||||||
$needWhere = FALSE;
|
|
||||||
$needAnd = TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (common_config('public', 'blacklist')) {
|
||||||
|
$parts[] = 'profile_id not in (' . implode(',', common_config('public', 'blacklist')) . ')';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($parts) {
|
||||||
|
$qry .= ' WHERE ' . implode(' AND ', $parts);
|
||||||
|
}
|
||||||
|
|
||||||
return Notice::getStream($qry,
|
return Notice::getStream($qry,
|
||||||
'public',
|
'public',
|
||||||
$offset, $limit, $since_id, $before_id);
|
$offset, $limit, $since_id, $before_id);
|
||||||
|
|
|
@ -92,6 +92,10 @@ $config['db']['database'] = 'mysql://laconica:microblog@localhost/laconica';
|
||||||
#optionally show non-local messages in public timeline
|
#optionally show non-local messages in public timeline
|
||||||
#$config['public']['localonly'] = false;
|
#$config['public']['localonly'] = false;
|
||||||
|
|
||||||
|
#hide certain users from public pages, by ID
|
||||||
|
#$config['public']['blacklist'][] = 123;
|
||||||
|
#$config['public']['blacklist'][] = 2307;
|
||||||
|
|
||||||
#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.
|
||||||
|
|
|
@ -86,7 +86,8 @@ $config =
|
||||||
'avatar' =>
|
'avatar' =>
|
||||||
array('server' => NULL),
|
array('server' => NULL),
|
||||||
'public' =>
|
'public' =>
|
||||||
array('localonly' => true),
|
array('localonly' => true,
|
||||||
|
'blacklist' => array()),
|
||||||
'theme' =>
|
'theme' =>
|
||||||
array('server' => NULL),
|
array('server' => NULL),
|
||||||
'xmpp' =>
|
'xmpp' =>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user