From fcd41e8c2bb5bc76c4255fd0b554d39978b89c16 Mon Sep 17 00:00:00 2001 From: Hannes Mannerheim Date: Fri, 26 Feb 2016 18:22:41 +0100 Subject: [PATCH] don't show sandboxed users in public timelines, unless you are a mod --- classes/PublicAndExternalNoticeStream.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/classes/PublicAndExternalNoticeStream.php b/classes/PublicAndExternalNoticeStream.php index 5e85aff..06fe944 100644 --- a/classes/PublicAndExternalNoticeStream.php +++ b/classes/PublicAndExternalNoticeStream.php @@ -71,6 +71,18 @@ class RawPublicAndExternalNoticeStream extends NoticeStream $notice->whereAdd('is_local !='. Notice::GATEWAY); $notice->whereAdd('repeat_of IS NULL'); + // don't show sandboxed users in public timelines, unless you are a mod + $hide_sandboxed = true; + $cur_profile = Profile::current(); + if($cur_profile instanceof Profile) { + if($cur_profile->hasRight(Right::REVIEWSPAM)) { + $hide_sandboxed = false; + } + } + if($hide_sandboxed) { + $notice->whereAdd('profile_id NOT IN (SELECT profile_id FROM profile_role WHERE role =\''.Profile_role::SANDBOXED.'\')'); + } + if(!empty($max_id) && is_numeric($max_id)) { $notice->whereAdd('id < '.$max_id); }