summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/Notice.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 92d4b8832..c392c39c9 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -357,17 +357,22 @@ class Notice extends Memcached_DataObject
function publicStream($offset=0, $limit=20, $since_id=0, $before_id=0) {
- $needAnd = FALSE;
- $needWhere = TRUE;
-
+ $parts = array();
+
$qry = 'SELECT * FROM notice ';
if (common_config('public', 'localonly')) {
- $qry .= ' WHERE is_local = 1 ';
- $needWhere = FALSE;
- $needAnd = TRUE;
+ $parts[] = 'is_local = 1';
+ }
+
+ 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,
'public',
$offset, $limit, $since_id, $before_id);