function saveNoticeFromActivity($activity, $actor, $options=array())
{
if (count($activity->objects) != 1) {
- throw new Exception(_('Too many activity objects.'));
+ // TRANS: Exception thrown when there are too many activity objects.
+ throw new Exception(_m('Too many activity objects.'));
}
$happeningObj = $activity->objects[0];
return new RSVPListItem($nli);
break;
}
+ return null;
}
return true;
}
- function onStartShowThreadedNoticeTail($nli, $notice, &$children)
+ function onStartAddNoticeReply($nli, $parent, $child)
{
// Filter out any poll responses
- if ($notice->object_type == Happening::OBJECT_TYPE) {
- $children = array_filter($children, array($this, 'isNotRSVP'));
+ if (($parent->object_type == Happening::OBJECT_TYPE) &&
+ in_array($child->object_type, array(RSVP::POSITIVE, RSVP::NEGATIVE, RSVP::POSSIBLE))) {
+ return false;
}
return true;
}
-
- function isNotRSVP($notice)
- {
- return (!in_array($notice->object_type, array(RSVP::POSITIVE, RSVP::NEGATIVE, RSVP::POSSIBLE)));
- }
}