]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/mailhandler.php
correct number of notices on a page
[quix0rs-gnu-social.git] / lib / mailhandler.php
index 85be89f1868540b10e41f232ed9d4cdff82f26e6..459657ffe0d3f01bec851789e017bc532a63eebc 100644 (file)
@@ -55,10 +55,11 @@ class MailHandler
             return true;
         }
         $msg = $this->cleanup_msg($msg);
-        $msg = common_shorten_links($msg);
+        $msg = $user->shortenLinks($msg);
         if (Notice::contentTooLong($msg)) {
-            $this->error($from, sprintf(_('That\'s too long. '.
-                                          'Max notice size is %d chars.'),
+            $this->error($from, sprintf(_('That\'s too long. Maximum notice size is %d character.',
+                                          'That\'s too long. Maximum notice size is %d characters.',
+                                          Notice::maxContent()),
                                         Notice::maxContent()));
         }
 
@@ -160,7 +161,7 @@ class MailHandler
         foreach($mediafiles as $mf){
             $mf->attachToNotice($notice);
         }
-        common_broadcast_notice($notice);
+
         $this->log(LOG_INFO,
                    'Added notice ' . $notice->id . ' from user ' . $user->nickname);
         return true;
@@ -265,6 +266,10 @@ class MailHandler
             if (preg_match('/^\s*Begin\s+forward/', $line)) {
                 break;
             }
+            // skip everything after a blank line if we already have content
+            if ($output !== '' && $line === '') {
+                break;
+            }
 
             $output .= ' ' . $line;
         }