self::blow('reply:stream:%d', $parentauthor->id);
} catch (NoParentNoticeException $e) {
// Not a reply, since it has no parent!
+ $parent = null;
} catch (NoResultException $e) {
// Parent notice was probably deleted
+ $parent = null;
}
// @todo ideally this parser information would only
// be calculated once.
- $mentions = common_find_mentions($this->content, $this);
+ $mentions = common_find_mentions($this->content, $sender, $parent);
// store replied only for first @ (what user/notice what the reply directed,
// we assume first @ is it)
if (Event::handle('StartActivityObjectFromNotice', array($this, &$object))) {
$object->type = $this->object_type ?: ActivityObject::NOTE;
$object->id = $this->getUri();
+ //FIXME: = $object->title ?: sprintf(... because we might get a title from StartActivityObjectFromNotice
$object->title = sprintf('New %1$s by %2$s', ActivityObject::canonicalType($object->type), $this->getProfile()->getNickname());
$object->content = $this->rendered;
$object->link = $this->getUrl();
return false;
}
+ public function hasParent()
+ {
+ try {
+ $this->getParent();
+ } catch (NoParentNoticeException $e) {
+ return false;
+ }
+ return true;
+ }
+
public function getParent()
{
$reply_to_id = null;