]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Favorite/classes/Fave.php
Merge remote-tracking branch 'upstream/master' into social-master
[quix0rs-gnu-social.git] / plugins / Favorite / classes / Fave.php
index bad8d42b8c5e747d4434b762b77208574a7349ab..f8880c5be3f6abf36e8e172b364da5d50f2b8a81 100644 (file)
@@ -63,7 +63,7 @@ class Fave extends Managed_DataObject
         //        notice's nickname and %3$s is the content of the favorited notice.)
         $act->content = sprintf(_('%1$s favorited something by %2$s: %3$s'),
                                 $actor->getNickname(), $target->getProfile()->getNickname(),
-                                $target->rendered ?: $target->content);
+                                $target->getRendered());
         $act->actor   = $actor->asActivityObject();
         $act->target  = $target->asActivityObject();
         $act->objects = array(clone($act->target));
@@ -186,7 +186,7 @@ class Fave extends Managed_DataObject
         //        notice's nickname and %3$s is the content of the favorited notice.)
         $act->content = sprintf(_('%1$s favorited something by %2$s: %3$s'),
                                 $actor->getNickname(), $target->getProfile()->getNickname(),
-                                $target->rendered ?: $target->content);
+                                $target->getRendered());
 
         $act->actor     = $actor->asActivityObject();
         $act->target    = $target->asActivityObject();
@@ -343,7 +343,7 @@ class Fave extends Managed_DataObject
         $actobj->objects = array(clone($actobj->target));
         $actobj->verb = ActivityVerb::FAVORITE;
         $actobj->title = ActivityUtils::verbToTitle($actobj->verb);
-        $actobj->content = $this->getTarget()->rendered ?: $this->getTarget()->content;
+        $actobj->content = $this->getTarget()->getRendered();
         return $actobj;
     }
 
@@ -353,6 +353,8 @@ class Fave extends Managed_DataObject
      */
     static public function parseActivityObject(ActivityObject $actobj, Notice $stored)
     {
+        // throws exception if nothing was found, but it could also be a non-Notice...
+        // FIXME: This should only test _one_ URI (and not the links etc.) though a function like this could be useful in other cases
         $local = ActivityUtils::findLocalObject($actobj->getIdentifiers());
         if (!$local instanceof Notice) {
             // $local always returns something, but this was not what we expected. Something is wrong.