]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/ActivityVerbPost/ActivityVerbPostPlugin.php
Avoid having to check for notices without rendered copies in upgrade.php
[quix0rs-gnu-social.git] / plugins / ActivityVerbPost / ActivityVerbPostPlugin.php
index 6dd182bc924740b8d266d4b8d30a3ec8b27f49d0..a28009e2fcc1b977403bbfbd216a2643d6a6b73f 100644 (file)
@@ -54,6 +54,9 @@ class ActivityVerbPostPlugin extends ActivityVerbHandlerPlugin
         assert($this->isMyActivity($act));
 
         $stored->object_type = ActivityUtils::resolveUri($act->objects[0]->type);
+        if (common_valid_http_url($act->objects[0]->link)) {
+            $stored->url = $act->objects[0]->link;
+        }
 
         // We don't have to do just about anything for a new, remote notice since the fields
         // are handled in the main Notice::saveActivity function. Such as content, attachments,
@@ -71,7 +74,7 @@ class ActivityVerbPostPlugin extends ActivityVerbHandlerPlugin
         $object->type    = $notice->object_type ?: ActivityObject::NOTE;
         $object->id      = $notice->getUri();
         $object->title   = sprintf('New %1$s by %2$s', ActivityObject::canonicalType($object->type), $notice->getProfile()->getNickname());
-        $object->content = $notice->rendered;
+        $object->content = $notice->getRendered();
         $object->link    = $notice->getUrl();
 
         $object->extra[] = array('status_net', array('notice_id' => $notice->getID()));
@@ -99,7 +102,7 @@ class ActivityVerbPostPlugin extends ActivityVerbHandlerPlugin
 
     protected function showNoticeContent(Notice $stored, HTMLOutputter $out, Profile $scoped=null)
     {
-        $out->raw($stored->rendered);
+        $out->raw($stored->getRendered());
     }
 
     protected function getActionTitle(ManagedAction $action, $verb, Notice $target, Profile $scoped)