require_once(INSTALLDIR . '/lib/mediafile.php');
require_once('Mail/mimeDecode.php');
-# FIXME: we use both Mail_mimeDecode and mailparse
-# Need to move everything to mailparse
+// FIXME: we use both Mail_mimeDecode and mailparse
+// Need to move everything to mailparse
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()));
}
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;
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;
}