]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Message.php
Add urlshortenerplugin2.php to solve some @todo's and adding exceptions
[quix0rs-gnu-social.git] / classes / Message.php
index 211284ecec86ab7dcde197d7523416a893c58ff3..2f5938adcb21b3fc77bd3f82fdb57237a0aea7da 100644 (file)
@@ -81,12 +81,14 @@ class Message extends Managed_DataObject
 
         $msg->from_profile = $from;
         $msg->to_profile = $to;
-        if ($user) {
+
+        if ($user instanceof User) {
             // Use the sender's URL shortening options.
             $msg->content = $user->shortenLinks($content);
         } else {
             $msg->content = common_shorten_links($content);
         }
+
         $msg->rendered = common_render_text($msg->content);
         $msg->created = common_sql_now();
         $msg->source = $source;
@@ -183,8 +185,8 @@ class Message extends Managed_DataObject
                 throw new Exception(sprintf("Sender profile not found: %d", $this->from_profile));
             }
             
-            $act->actor            = ActivityObject::fromProfile($profile);
-            $act->actor->extra[]   = $profile->profileInfo(null);
+            $act->actor            = $profile->asActivityObject();
+            $act->actor->extra[]   = $profile->profileInfo();
 
             $act->verb = ActivityVerb::POST;