Merge branch '0.9.x' into schema

This commit is contained in:
Evan Prodromou
2009-10-01 11:30:04 -04:00
71 changed files with 1617 additions and 759 deletions

View File

@@ -101,7 +101,7 @@ function newSub($i)
$to = User::staticGet('nickname', $tunic);
if (empty($from)) {
if (empty($to)) {
throw new Exception("Can't find user '$tunic'.");
}

View File

@@ -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);

View File

@@ -323,12 +323,15 @@ class XMPPDaemon extends Daemon
mb_strlen($content_shortened)));
return;
}
$notice = Notice::saveNew($user->id, $content_shortened, 'xmpp');
if (is_string($notice)) {
$this->log(LOG_ERR, $notice);
$this->from_site($user->jabber, $notice);
try {
$notice = Notice::saveNew($user->id, $content_shortened, 'xmpp');
} catch (Exception $e) {
$this->log(LOG_ERR, $e->getMessage());
$this->from_site($user->jabber, $e->getMessage());
return;
}
common_broadcast_notice($notice);
$this->log(LOG_INFO,
'Added notice ' . $notice->id . ' from user ' . $user->nickname);