]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge commit 'refs/merge-requests/27' of https://gitorious.org/social/mainline into...
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 9 Dec 2014 12:30:47 +0000 (13:30 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 9 Dec 2014 12:30:47 +0000 (13:30 +0100)
1  2 
classes/Notice.php

diff --combined classes/Notice.php
index 62f6d1a685a9bf9fca590c01c66ee88d3c3a4fa2,ed3104de2be26521008e70f9f02c7d4ef7ae81eb..20374e0e2e06233ed03c9298aedb58d51f0ff27f
@@@ -608,7 -608,7 +608,7 @@@ class Notice extends Managed_DataObjec
              if (empty($notice->conversation) and !empty($options['conversation'])) {
                  $conv = Conversation::getKV('uri', $options['conversation']);
                  if ($conv instanceof Conversation) {
 -                    common_debug('Conversation stitched together from (probably) reply to unknown remote user. Activity creation time ('.$activity->time.') should maybe be compared to conversation creation time ('.$conv->created.').');
 +                    common_debug('Conversation stitched together from (probably) reply to unknown remote user. Activity creation time ('.$notice->created.') should maybe be compared to conversation creation time ('.$conv->created.').');
                      $notice->conversation = $conv->id;
                  } else {
                      // Conversation URI was not found, so we must create it. But we can't create it
          }
  
          // 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)) {