]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apistatusesupdate.php
MediaFile code improvements, preparing to implement multi-attachments
[quix0rs-gnu-social.git] / actions / apistatusesupdate.php
index 2e1ddc22745c7a19fc08ea480dcdf3c163afb844..374930fff007f9d2d47c4542df4b8f3d5f30a726 100644 (file)
@@ -129,9 +129,6 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-require_once INSTALLDIR . '/lib/apiauth.php';
-require_once INSTALLDIR . '/lib/mediafile.php';
-
 /**
  * Updates the authenticating user's status (posts a notice).
  *
@@ -254,7 +251,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
             if (!empty($this->in_reply_to_status_id)) {
                 // Check whether notice actually exists
 
-                $reply = Notice::staticGet($this->in_reply_to_status_id);
+                $reply = Notice::getKV($this->in_reply_to_status_id);
 
                 if ($reply) {
                     $reply_to = $this->in_reply_to_status_id;
@@ -272,7 +269,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
             $upload = null;
 
             try {
-                $upload = MediaFile::fromUpload('media', $this->auth_user);
+                $upload = MediaFile::fromUpload('media', $this->auth_user->getProfile());
             } catch (Exception $e) {
                 $this->clientError($e->getMessage(), $e->getCode(), $this->format);
                 return;
@@ -285,7 +282,7 @@ class ApiStatusesUpdateAction extends ApiAuthAction
             }
 
             /* Do call shortenlinks here & check notice length since notice is about to be saved & sent */
-            $status_shortened = $this->auth_user->shortenlinks($status_shortened);
+            $status_shortened = $this->auth_user->shortenlinks($this->status);
 
             if (Notice::contentTooLong($status_shortened)) {
                 if (isset($upload)) {