X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fmailhandler.php;h=459657ffe0d3f01bec851789e017bc532a63eebc;hb=119d0f7dbab40f30170ba263de78d7e9cea984db;hp=32a8cd9bc5ab34f5de04fef9071fe49b5f3d161f;hpb=d59df6b27013fb534d6444d8e4790f2edcd9459a;p=quix0rs-gnu-social.git diff --git a/lib/mailhandler.php b/lib/mailhandler.php index 32a8cd9bc5..459657ffe0 100644 --- a/lib/mailhandler.php +++ b/lib/mailhandler.php @@ -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())); } @@ -139,7 +140,7 @@ class MailHandler $headers['From'] = $to; $headers['To'] = $from; - $headers['Subject'] = "Command complete"; + $headers['Subject'] = _('Command complete'); return mail_send(array($from), $headers, $response); } @@ -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; @@ -225,7 +226,7 @@ class MailHandler function unsupported_type($type) { - $this->error(null, "Unsupported message type: " . $type); + $this->error(null, sprintf(_('Unsupported message type: %s'), $type)); } function cleanup_msg($msg) @@ -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; }