]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Only set ->actor in a case where it has not yet been set
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 13 Oct 2015 23:18:28 +0000 (01:18 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 13 Oct 2015 23:20:50 +0000 (01:20 +0200)
Otherwise it could overwrite it with the wrong actor (the "second round"
for share activities)

plugins/Share/SharePlugin.php

index 5b5d374abe372f79923c1f13b60102c5b7166ea1..cfa93de7fa11c463270fdc83fe198c414b40c145 100644 (file)
@@ -156,7 +156,6 @@ class SharePlugin extends ActivityVerbHandlerPlugin
     {
         // TODO: How to handle repeats of deleted notices?
         $target = Notice::getByID($stored->repeat_of);
-        $act->actor = $target->getProfile()->asActivityObject();
         // 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'),
@@ -170,6 +169,7 @@ class SharePlugin extends ActivityVerbHandlerPlugin
         // Repeat is a little bit special. As it's an activity, our
         // ActivityObject is instead turned into an Activity
         $object          = new Activity();
+        $object->actor   = $stored->getProfile()->asActivityObject();
         $object->verb    = ActivityVerb::SHARE;
         $object->content = $stored->rendered;
         $this->extendActivity($stored, $object);