From b80ece169161900a8fc865f50fe13e6aa2f1a620 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 9 Apr 2011 17:07:03 -0400 Subject: [PATCH] hide poll response notices from threaded view --- plugins/Poll/PollPlugin.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/Poll/PollPlugin.php b/plugins/Poll/PollPlugin.php index 4e7b2c5273..f9b5808b1c 100644 --- a/plugins/Poll/PollPlugin.php +++ b/plugins/Poll/PollPlugin.php @@ -480,4 +480,18 @@ class PollPlugin extends MicroAppPlugin // TRANS: Application title. return _m('APPTITLE','Poll'); } + + function onStartShowThreadedNoticeTail($nli, $notice, &$children) + { + // Filter out any poll responses + if ($notice->object_type == self::POLL_OBJECT) { + $children = array_filter($children, array($this, 'isNotPollResponse')); + } + return true; + } + + function isNotPollResponse($notice) + { + return ($notice->object_type != self::POLL_RESPONSE_OBJECT); + } } -- 2.39.5