summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2008-12-02 13:42:58 -0500
committerEvan Prodromou <evan@controlyourself.ca>2008-12-02 13:42:58 -0500
commit0bcfb2e6983fd487bd35132653e9a2bfb1ceebb1 (patch)
tree2cbba22eff01c514a62fd56face3f4fe61f11243
parenta6a0cf08a20dadc27bf88127d1fe2712484814b9 (diff)
change is_local flag for blacklisted users
Changed the flag on notices that says whether the notice is local, so that it's -1 for local-but-blacklisted. This should keep blacklisted users off the public timeline. darcs-hash:20081202184258-5ed1f-cd87ea5c528ea0c90cb31eeb59d4d1ba4f85e9ad.gz
-rw-r--r--classes/Notice.php21
1 files changed, 15 insertions, 6 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 98a77e20d..6d42a4f9a 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -95,7 +95,17 @@ class Notice extends Memcached_DataObject
$notice = new Notice();
$notice->profile_id = $profile_id;
- $notice->is_local = $is_local;
+
+ $blacklist = common_config('public', 'blacklist');
+
+ # Blacklisted are non-false, but not 1, either
+
+ if ($blacklist && in_array($profile_id, $blacklist)) {
+ $notice->is_local = -1;
+ } else {
+ $notice->is_local = $is_local;
+ }
+
$notice->reply_to = $reply_to;
$notice->created = common_sql_now();
$notice->content = $content;
@@ -214,7 +224,7 @@ class Notice extends Memcached_DataObject
}
function blowPublicCache($blowLast=false) {
- if ($this->is_local) {
+ if ($this->is_local == 1) {
$cache = common_memcache();
if ($cache) {
$cache->delete(common_cache_key('public'));
@@ -426,10 +436,9 @@ class Notice extends Memcached_DataObject
if (common_config('public', 'localonly')) {
$parts[] = 'is_local = 1';
- }
-
- if (common_config('public', 'blacklist')) {
- $parts[] = 'profile_id not in (' . implode(',', common_config('public', 'blacklist')) . ')';
+ } else {
+ # -1 == blacklisted
+ $parts[] = 'is_local != -1';
}
if ($parts) {