No need to do pkeyGet if not repeated (thanks hannes)

Kind of reverts commit d9ed2a0
This commit is contained in:
Mikael Nordfeldth 2015-03-13 09:49:09 +01:00
parent d9ed2a0fae
commit 4f2095ea00

View File

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