X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FShare%2FSharePlugin.php;h=c337efbaeca10660b02376212f006df46cee722e;hb=dd03e55e125c357eeaeca5eb41d04e7c031824c2;hp=69761a5f3d45df4b3e8bf0ec4e6fe752f3e2479c;hpb=a647a4f6b3531d3f8e6003d32403b5f30599e952;p=quix0rs-gnu-social.git diff --git a/plugins/Share/SharePlugin.php b/plugins/Share/SharePlugin.php index 69761a5f3d..c337efbaec 100644 --- a/plugins/Share/SharePlugin.php +++ b/plugins/Share/SharePlugin.php @@ -161,7 +161,7 @@ class SharePlugin extends ActivityVerbHandlerPlugin public function extendActivity(Notice $stored, Activity $act, Profile $scoped=null) { // TODO: How to handle repeats of deleted notices? - $target = Notice::getById($stored->repeat_of); + $target = Notice::getByID($stored->repeat_of); // TRANS: A repeat activity's title. %1$s is repeater's nickname // and %2$s is the repeated user's nickname. $act->title = sprintf(_('%1$s repeated a notice by %2$s'), @@ -278,10 +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); - } else { - $status['repeated'] = false; + $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())); + $status['repeated_id'] = $repeated->getID(); } }