]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - scripts/maildaemon.php
Merge branch '0.8.x' into 0.9.x
[quix0rs-gnu-social.git] / scripts / maildaemon.php
index 67636d34263572099c674307ea6beb5cfdefc795..586bef624ea154d2a53d60c7a71d7313cd18bf83 100755 (executable)
@@ -1,8 +1,8 @@
 #!/usr/bin/env php
 <?php
 /*
- * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, 2009, Control Yourself, Inc.
+ * StatusNet - the distributed open-source microblogging tool
+ * Copyright (C) 2008, 2009, StatusNet, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -260,10 +260,11 @@ class MailerDaemon
 
     function add_notice($user, $msg, $fileRecords)
     {
-        $notice = Notice::saveNew($user->id, $msg, 'mail');
-        if (is_string($notice)) {
-            $this->log(LOG_ERR, $notice);
-            return $notice;
+        try {
+            $notice = Notice::saveNew($user->id, $msg, 'mail');
+        } catch (Exception $e) {
+            $this->log(LOG_ERR, $e->getMessage());
+            return $e->getMessage();
         }
         foreach($fileRecords as $fileRecord){
             $this->attachFile($notice, $fileRecord);