From: Joshua Judson Rosen Date: Tue, 9 Dec 2014 03:39:36 +0000 (-0500) Subject: Consistently root autostitched conversations at the oldest notice. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=06235a3aa36af671f956084d0f2c24ac9461f4e8;p=quix0rs-gnu-social.git Consistently root autostitched conversations at the oldest notice. --- diff --git a/classes/Notice.php b/classes/Notice.php index 9328a76bb8..ed3104de2b 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -1271,10 +1271,16 @@ class Notice extends Managed_DataObject } // If this isn't a reply to anything, then it's its own - // root. + // root if it's the earliest notice in the conversation: if (empty($this->reply_to)) { - return $this; + $root = new Notice; + $root->conversation = $this->conversation; + $root->orderBy('notice.created ASC'); + $root->find(); + $root->fetch(); + $root->free(); + return $root; } if (is_null($profile)) {