X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FNotice.php;fp=classes%2FNotice.php;h=e7c305b2d9408567e1601f8b4c1d8ed031abb682;hb=10973dcf697214184aae5496673484a99fdf5f42;hp=43ffa0833fc01f49587d9dd3e463693924e1d73d;hpb=86106b890a45c9cd3f965259ecbed551ac55a9db;p=quix0rs-gnu-social.git diff --git a/classes/Notice.php b/classes/Notice.php index 43ffa0833f..e7c305b2d9 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1635,14 +1635,16 @@ class Notice extends Managed_DataObject 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) @@ -2049,6 +2051,7 @@ class Notice extends Managed_DataObject 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(); @@ -2769,6 +2772,16 @@ class Notice extends Managed_DataObject return false; } + public function hasParent() + { + try { + $this->getParent(); + } catch (NoParentNoticeException $e) { + return false; + } + return true; + } + public function getParent() { $reply_to_id = null;