]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/newnotice.php
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
[quix0rs-gnu-social.git] / actions / newnotice.php
index 4c6372c2bb96eac658aa94be085ee05c29ce4d49..9ee031f93636b0003f5ae6937c4bc9e892f64d48 100644 (file)
@@ -240,6 +240,10 @@ class NewnoticeAction extends Action
             $this->maybeAddRedir($fileRecord->id, $fileurl);
 
             $short_fileurl = common_shorten_url($fileurl);
+            if (!$short_fileurl) {
+                // todo -- Consider forcing default shortener if none selected?
+                $short_fileurl = $fileurl;
+            }
             $content_shortened .= ' ' . $short_fileurl;
 
             if (Notice::contentTooLong($content_shortened)) {
@@ -255,13 +259,6 @@ class NewnoticeAction extends Action
         $notice = Notice::saveNew($user->id, $content_shortened, 'web', 1,
                                   ($replyto == 'false') ? null : $replyto);
 
-        if (is_string($notice)) {
-            if (isset($filename)) {
-                $this->deleteFile($filename);
-            }
-            $this->clientError($notice);
-        }
-
         if (isset($mimetype)) {
             $this->attachFile($notice, $fileRecord);
         }
@@ -433,13 +430,14 @@ class NewnoticeAction extends Action
         $content = $this->trimmed('status_textarea');
         if (!$content) {
             $replyto = $this->trimmed('replyto');
+            $inreplyto = $this->trimmed('inreplyto');
             $profile = Profile::staticGet('nickname', $replyto);
             if ($profile) {
                 $content = '@' . $profile->nickname . ' ';
             }
         }
 
-        $notice_form = new NoticeForm($this, '', $content);
+        $notice_form = new NoticeForm($this, '', $content, null, $inreplyto);
         $notice_form->show();
     }