]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Consistently root autostitched conversations at the oldest notice.
authorJoshua Judson Rosen <rozzin@geekspace.com>
Tue, 9 Dec 2014 03:39:36 +0000 (22:39 -0500)
committerJoshua Judson Rosen <rozzin@geekspace.com>
Tue, 9 Dec 2014 03:39:36 +0000 (22:39 -0500)
classes/Notice.php

index 9328a76bb876b54b647c5a367cf1aa9161c2eb02..ed3104de2be26521008e70f9f02c7d4ef7ae81eb 100644 (file)
@@ -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)) {