]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Use getParent instead of manual reply_to lookup
authorMikael Nordfeldth <mmn@hethane.se>
Mon, 28 Oct 2013 16:24:13 +0000 (17:24 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 28 Oct 2013 16:28:10 +0000 (17:28 +0100)
classes/Notice.php

index f59946ff465b22b766df6327f849ba543b34b874..4d5819bd5810e656fe1634a7b10981ac589ed12f 100644 (file)
@@ -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();