]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
No need to do pkeyGet if not repeated (thanks hannes)
authorMikael Nordfeldth <mmn@hethane.se>
Fri, 13 Mar 2015 08:49:09 +0000 (09:49 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Fri, 13 Mar 2015 08:49:09 +0000 (09:49 +0100)
Kind of reverts commit d9ed2a0

plugins/Share/SharePlugin.php

index eb874d2941cf193aaa749ade1e4a2766f960d610..b5643c1d0912f6b68767a1af0d71d744c8760f03 100644 (file)
@@ -278,16 +278,15 @@ class SharePlugin extends ActivityVerbHandlerPlugin
      */
     public function onNoticeSimpleStatusArray($notice, array &$status, Profile $scoped=null, array $args=array())
     {
-        if ($scoped instanceof Profile) {
-            $status['repeated'] = $scoped->hasRepeated($notice);
+        $status['repeated'] = $scoped instanceof Profile
+                            ? $scoped->hasRepeated($notice)
+                            : false;
+
+        if ($status['repeated'] === true) {
             // Qvitter API wants the "repeated_id" value set too.
             $repeated = Notice::pkeyGet(array('profile_id' => $scoped->getID(),
                                               'repeat_of' => $notice->getID()));
-            if ($repeated instanceof Notice) {
-                $status['repeated_id'] = $repeated->getID();
-            }
-        } else {
-            $status['repeated'] = false;
+            $status['repeated_id'] = $repeated->getID();
         }
     }