+ $sent_to[$user->id] = 1;
+ }
+ }
+
+ // Now, get users who have it in their inbox because of groups
+
+ $user = new User();
+ $user->query("SELECT $UT.id, $UT.jabber " .
+ "FROM $UT JOIN notice_inbox " .
+ "ON $UT.id = notice_inbox.user_id " .
+ 'WHERE notice_inbox.notice_id = ' . $notice->id . ' ' .
+ 'AND notice_inbox.source = 2 ' .
+ 'AND user.jabber is not null ' .
+ 'AND user.jabbernotify = 1 ');
+
+ while ($user->fetch()) {
+ if (!array_key_exists($user->id, $sent_to)) {
+ common_log(LOG_INFO,
+ 'Sending notice ' . $notice->id . ' to ' . $user->jabber,
+ __FILE__);
+ $conn->message($user->jabber, $msg, 'chat', null, $entry);
+ // To keep the incoming queue from filling up,
+ // we service it after each send.
+ $conn->processTime(0);
+ $sent_to[$user->id] = 1;