static function fromNotice(Notice $notice) { $object = new ActivityObject(); if (Event::handle('StartActivityObjectFromNotice', array($notice, &$object))) { $object->type = empty($notice->object_type) ? ActivityObject::NOTE : $notice->object_type; $object->id = $notice->uri; $object->title = $notice->content; $object->content = $notice->rendered; $object->link = $notice->bestUrl(); Event::handle('EndActivityObjectFromNotice', array($notice, &$object)); } return $object; }
/** * Mirror a notice by emitting a new notice with the same contents. * Kind of dirty, but if pulling an external data feed into an account * that may be what you want. * * @param Notice $notice * @return mixed Notice on successful repeat, true if already repeated, false on failure */ protected function copyNotice($profile, $notice) { $options = array('is_local' => Notice::LOCAL_PUBLIC, 'url' => $notice->bestUrl(), 'rendered' => $notice->rendered); $saved = Notice::saveNew($profile->id, $notice->content, 'feed', $options); return $saved; }
static function fromNotice(Notice $notice) { $object = new ActivityObject(); $object->type = ActivityObject::NOTE; $object->id = $notice->uri; $object->title = $notice->content; $object->content = $notice->rendered; $object->link = $notice->bestUrl(); return $object; }