From: Evan Prodromou Date: Fri, 23 Jan 2009 02:29:26 +0000 (+0100) Subject: Make sure group messages go out over Jabber X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4bd3eae79dec8fb99602a7a1aef0e96c17972778;p=quix0rs-gnu-social.git Make sure group messages go out over Jabber --- diff --git a/lib/jabber.php b/lib/jabber.php index 099ded9ebd..c33722ea51 100644 --- a/lib/jabber.php +++ b/lib/jabber.php @@ -395,6 +395,27 @@ function jabber_broadcast_notice($notice) } } + // Now, get users who have it in their inbox because of groups + + $user = new User(); + $user->query('SELECT user.id, user.jabber ' . + 'FROM user JOIN notice_inbox ' . + 'ON user.id = notice_inbox.user_id ' . + 'WHERE notice_inbox.notice_id = ' . $notice->id . ' ' . + 'AND notice_inbox.source = 2 '); + + 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); + } + } + $user->free(); return true;