diff options
author | Brion Vibber <brion@pobox.com> | 2009-10-04 16:16:52 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2009-10-04 16:16:52 -0700 |
commit | 4462a1c63600fa83d2692ac2de8067b12b1eeac9 (patch) | |
tree | a946b98184eb32b5be4bf64e67357c06e8d0f65d /scripts/xmppdaemon.php | |
parent | 9235c1437e542d2b565d2d2d36fe2b7561e4d5f7 (diff) | |
parent | 2f065d687dc76bfbac3e1b7b3dcccf544f4b4987 (diff) |
Merge branch '0.9.x' of git://gitorious.org/statusnet/mainline into 0.9.x
Diffstat (limited to 'scripts/xmppdaemon.php')
-rwxr-xr-x | scripts/xmppdaemon.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/xmppdaemon.php b/scripts/xmppdaemon.php index 1b1aec3e6..b2efc07c3 100755 --- a/scripts/xmppdaemon.php +++ b/scripts/xmppdaemon.php @@ -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); |