From: Mikael Nordfeldth Date: Fri, 13 Mar 2015 08:49:09 +0000 (+0100) Subject: No need to do pkeyGet if not repeated (thanks hannes) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4f2095ea006bef969dded5570f3451c8230b9d04;p=quix0rs-gnu-social.git No need to do pkeyGet if not repeated (thanks hannes) Kind of reverts commit d9ed2a0 --- diff --git a/plugins/Share/SharePlugin.php b/plugins/Share/SharePlugin.php index eb874d2941..b5643c1d09 100644 --- a/plugins/Share/SharePlugin.php +++ b/plugins/Share/SharePlugin.php @@ -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(); } }