From a5d870765833152b9a633fa96a36723e1facfc65 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Mon, 28 Oct 2013 17:24:13 +0100 Subject: [PATCH] Use getParent instead of manual reply_to lookup --- classes/Notice.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index f59946ff46..4d5819bd58 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1552,12 +1552,12 @@ class Notice extends Managed_DataObject $ctx = new ActivityContext(); - if (!empty($this->reply_to)) { - $reply = Notice::getKV('id', $this->reply_to); - if (!empty($reply)) { - $ctx->replyToID = $reply->uri; - $ctx->replyToUrl = $reply->bestUrl(); - } + try { + $reply = $this->getParent(); + $ctx->replyToID = $reply->uri; + $ctx->replyToUrl = $reply->bestUrl(); + } catch (Exception $e) { + // This is not a reply to something } $ctx->location = $this->getLocation();