function omb_broadcast_remote_subscribers($notice) { # First, get remote users subscribed to this profile $rp = new Remote_profile(); $rp->query('SELECT postnoticeurl, token, secret ' . 'FROM subscription JOIN remote_profile ' . 'ON subscription.subscriber = remote_profile.id ' . 'WHERE subscription.subscribed = ' . $notice->profile_id . ' '); $posted = array(); while ($rp->fetch()) { if (!$posted[$rp->postnoticeurl]) { common_log(LOG_DEBUG, 'Posting to ' . $rp->postnoticeurl); if (omb_post_notice_keys($notice, $rp->postnoticeurl, $rp->token, $rp->secret)) { common_log(LOG_DEBUG, 'Finished to ' . $rp->postnoticeurl); $posted[$rp->postnoticeurl] = true; } else { common_log(LOG_DEBUG, 'Failed posting to ' . $rp->postnoticeurl); } } } $rp->free(); unset($rp); return true; }