a little better notice hiding

This commit is contained in:
Evan Prodromou
2011-04-21 13:37:05 -04:00
parent 10cffa8afa
commit 36d56232c6
3 changed files with 31 additions and 27 deletions

View File

@@ -481,17 +481,13 @@ class PollPlugin extends MicroAppPlugin
return _m('APPTITLE','Poll');
}
function onStartShowThreadedNoticeTail($nli, $notice, &$children)
function onStartAddNoticeReply($nli, $parent, $child)
{
// Filter out any poll responses
if ($notice->object_type == self::POLL_OBJECT) {
$children = array_filter($children, array($this, 'isNotPollResponse'));
if ($parent->object_type == self::POLL_OBJECT &&
$child->object_type == self::POLL_RESPONSE_OBJECT) {
return false;
}
return true;
}
function isNotPollResponse($notice)
{
return ($notice->object_type != self::POLL_RESPONSE_OBJECT);
}
}