diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-06-14 11:27:22 -0700 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-06-14 11:27:22 -0700 |
commit | e0bdaa787ddf5102417ec35a4996e68cfc8981f2 (patch) | |
tree | 4acf850e7f15180120805b755d37825722f09267 /scripts | |
parent | b4e649fe906a793cd5e62d6390065ea5d41c40db (diff) | |
parent | 1c41afbd36580e2d5ad110bfb5ae0da53a7895b2 (diff) |
Merge branch '0.7.x' into 0.8.x
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/maildaemon.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/maildaemon.php b/scripts/maildaemon.php index b9facec1a..9dd647bf4 100755 --- a/scripts/maildaemon.php +++ b/scripts/maildaemon.php @@ -66,7 +66,13 @@ class MailerDaemon return true; } $msg = $this->cleanup_msg($msg); - $this->add_notice($user, $msg); + $err = $this->add_notice($user, $msg); + if (is_string($err)) { + $this->error($from, $err); + return false; + } else { + return true; + } } function error($from, $msg) @@ -130,17 +136,15 @@ class MailerDaemon function add_notice($user, $msg) { - // should test - // $msg_shortened = common_shorten_links($msg); - // if (mb_strlen($msg_shortened) > 140) ERROR and STOP $notice = Notice::saveNew($user->id, $msg, 'mail'); if (is_string($notice)) { $this->log(LOG_ERR, $notice); - return; + return $notice; } common_broadcast_notice($notice); $this->log(LOG_INFO, 'Added notice ' . $notice->id . ' from user ' . $user->nickname); + return true; } function parse_message($fname) |