X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fjabber.php;h=84d2a562cecccbb64791a158f1f88ec3ff66d4da;hb=3af566d1ecb5793324f7395ebec254848c47df09;hp=099ded9ebd53395b09765733539e07c86530b259;hpb=2d456a15e5652a0c0e2c0f9f50221eed2d16e109;p=quix0rs-gnu-social.git diff --git a/lib/jabber.php b/lib/jabber.php index 099ded9ebd..84d2a562ce 100644 --- a/lib/jabber.php +++ b/lib/jabber.php @@ -392,6 +392,29 @@ function jabber_broadcast_notice($notice) // To keep the incoming queue from filling up, // we service it after each send. $conn->processTime(0); + $sent_to[$user->id] = 1; + } + } + + // 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); + $sent_to[$user->id] = 1; } }