예제 #1
0
파일: omb.php 프로젝트: Br3nda/laconica
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;
}