diff options
author | Brion Vibber <brion@pobox.com> | 2010-01-13 18:17:36 +0000 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-01-13 18:17:36 +0000 |
commit | 0e1f2d4b47e5e340679c4245b62e1d64c6b9c9b9 (patch) | |
tree | 2b3c04fb0a0158fc63acc7896192cc7ddedfd7de /lib/jabber.php | |
parent | d84c33c3282523ea3553fa36ccd2aef39e4dcbad (diff) |
Fix regressions in XMPP output during inbox refactoring
- NOTICE_INBOX_SOURCE_* constants moved to common.php since Notice_inbox.php not always loaded
- fixed typo in User::staticGet() call which caused user #1 to receive messages once for each subscriber instead of for him/herself
- 'continue' -> 'continue 2' inside switch() statement to fix loop escape (PHP considers switch() a looping construct for break & continue)
Diffstat (limited to 'lib/jabber.php')
-rw-r--r-- | lib/jabber.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/jabber.php b/lib/jabber.php index 69f0d3570..4cdfa6746 100644 --- a/lib/jabber.php +++ b/lib/jabber.php @@ -359,7 +359,7 @@ function jabber_broadcast_notice($notice) $ni = $notice->whoGets(); foreach ($ni as $user_id => $reason) { - $user = User::staticGet('user_id', $user_id); + $user = User::staticGet($user_id); if (empty($user) || empty($user->jabber) || !$user->jabbernotify) { @@ -369,20 +369,20 @@ function jabber_broadcast_notice($notice) switch ($reason) { case NOTICE_INBOX_SOURCE_REPLY: if (!$user->jabberreplies) { - continue; + continue 2; } break; case NOTICE_INBOX_SOURCE_SUB: $sub = Subscription::pkeyGet(array('subscriber' => $user->id, 'subscribed' => $notice->profile_id)); if (empty($sub) || !$sub->jabber) { - continue; + continue 2; } break; case NOTICE_INBOX_SOURCE_GROUP: break; default: - throw new Exception(_("Unknown inbox source.")); + throw new Exception(sprintf(_("Unknown inbox source %d."), $reason)); } common_log(LOG_INFO, |