forked from GNUsocial/gnu-social
		
	quit trying to use fancy join and just loop
darcs-hash:20080606174822-84dde-2128b2a5a6e129b10741bb8a1b2cdcdacc4ca1ca.gz
This commit is contained in:
		| @@ -115,18 +115,18 @@ function omb_local_id($service) { | |||||||
| function omb_broadcast_remote_subscribers($notice) { | function omb_broadcast_remote_subscribers($notice) { | ||||||
| 	# First, get remote users subscribed to this profile | 	# First, get remote users subscribed to this profile | ||||||
| 	common_debug('starting broadcast for notice #'.$notice->id, __FILE__); | 	common_debug('starting broadcast for notice #'.$notice->id, __FILE__); | ||||||
|  | 	# XXX: use a join here rather than looping through results | ||||||
| 	$sub = new Subscription(); | 	$sub = new Subscription(); | ||||||
| 	$sub->subscribed = $notice->profile_id; | 	$sub->subscribed = $notice->profile_id; | ||||||
| 	$sub->selectAs(); |  | ||||||
| 	$rp = new Remote_profile(); |  | ||||||
| 	$sub->joinAdd($rp, 'INNER', NULL, 'subscriber'); |  | ||||||
| 	if ($sub->find()) { | 	if ($sub->find()) { | ||||||
| 		common_debug('Found subscriptions for '.$notice->id, __FILE__); | 		common_debug('Found subscriptions for '.$notice->id, __FILE__); | ||||||
| 		$posted = array(); | 		$posted = array(); | ||||||
| 		while ($sub->fetch()) { | 		while ($sub->fetch()) { | ||||||
| 			common_debug('sub = '.print_r($sub,TRUE), __FILE__); | 			common_debug('sub = '.print_r($sub,TRUE), __FILE__); | ||||||
| 			common_debug('rp = '.print_r($rp,TRUE), __FILE__);			 |  | ||||||
| 			common_debug('Subscription by profile '.$sub->subscriber, __FILE__); | 			common_debug('Subscription by profile '.$sub->subscriber, __FILE__); | ||||||
|  | 			$rp = Remote_profile::staticGet('id', $sub->subscriber); | ||||||
|  | 			if ($rp) { | ||||||
|  | 				common_debug('subscriber '.$rp->id.' is remote.', __FILE__); | ||||||
| 				if (!$posted[$rp->postnoticeurl]) { | 				if (!$posted[$rp->postnoticeurl]) { | ||||||
| 					common_debug('Not yet posted to '.$rp->postnoticeurl, __FILE__); | 					common_debug('Not yet posted to '.$rp->postnoticeurl, __FILE__); | ||||||
| 					if (omb_post_notice($notice, $rp, $sub)) { | 					if (omb_post_notice($notice, $rp, $sub)) { | ||||||
| @@ -137,6 +137,7 @@ function omb_broadcast_remote_subscribers($notice) { | |||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
| function omb_post_notice($notice, $remote_profile, $subscription) { | function omb_post_notice($notice, $remote_profile, $subscription) { | ||||||
| 	global $config; # for license URL | 	global $config; # for license URL | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user