summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-06-06 13:48:22 -0400
committerEvan Prodromou <evan@prodromou.name>2008-06-06 13:48:22 -0400
commit03beaef01c76635ce47e46486a3f2a30756502b1 (patch)
treeee03c539812fe410c2b3361aeb4c0cff64f8a962
parentebfc997de3e06b0e4269bc700c7a2ca80fb1ea8d (diff)
quit trying to use fancy join and just loop
darcs-hash:20080606174822-84dde-2128b2a5a6e129b10741bb8a1b2cdcdacc4ca1ca.gz
-rw-r--r--lib/omb.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/omb.php b/lib/omb.php
index 917acebaf..35b5c9e1f 100644
--- a/lib/omb.php
+++ b/lib/omb.php
@@ -115,23 +115,24 @@ function omb_local_id($service) {
function omb_broadcast_remote_subscribers($notice) {
# First, get remote users subscribed to this profile
common_debug('starting broadcast for notice #'.$notice->id, __FILE__);
+ # XXX: use a join here rather than looping through results
$sub = new Subscription();
$sub->subscribed = $notice->profile_id;
- $sub->selectAs();
- $rp = new Remote_profile();
- $sub->joinAdd($rp, 'INNER', NULL, 'subscriber');
if ($sub->find()) {
common_debug('Found subscriptions for '.$notice->id, __FILE__);
$posted = array();
while ($sub->fetch()) {
common_debug('sub = '.print_r($sub,TRUE), __FILE__);
- common_debug('rp = '.print_r($rp,TRUE), __FILE__);
common_debug('Subscription by profile '.$sub->subscriber, __FILE__);
- if (!$posted[$rp->postnoticeurl]) {
- common_debug('Not yet posted to '.$rp->postnoticeurl, __FILE__);
- if (omb_post_notice($notice, $rp, $sub)) {
- common_debug('successful update to '.$rp->postnoticeurl, __FILE__);
- $posted[$rp->postnoticeurl] = TRUE;
+ $rp = Remote_profile::staticGet('id', $sub->subscriber);
+ if ($rp) {
+ common_debug('subscriber '.$rp->id.' is remote.', __FILE__);
+ if (!$posted[$rp->postnoticeurl]) {
+ common_debug('Not yet posted to '.$rp->postnoticeurl, __FILE__);
+ if (omb_post_notice($notice, $rp, $sub)) {
+ common_debug('successful update to '.$rp->postnoticeurl, __FILE__);
+ $posted[$rp->postnoticeurl] = TRUE;
+ }
}
}
}