Revert randprof - that was stupid. If you have a local channel, you also have it's xchan.

This commit is contained in:
Thomas Willingham 2013-03-20 23:43:02 +00:00
parent 28975931b5
commit 499083d5d4

View File

@ -1,24 +1,11 @@
<?php <?php
function randprof_fallback() {
$r = q("select channel_address from channel where channel_r_stream = 1 order by rand() limit 1");
if($r)
return $r[0]['channel_address'];
return '';
}
function randprof_init(&$a) { function randprof_init(&$a) {
require_once('include/Contact.php'); require_once('include/Contact.php');
$x = random_profile(); $x = random_profile();
if($x) if($x)
goaway(chanlink_url($x)); goaway(chanlink_url($x));
// Nothing there, so try a local, public channel instead // FIXME this doesn't work at the moment as a fallback
else $x = randprof_fallback(); goaway($a->get_baseurl() . '/profile');
if($x) {
$goaway = (z_root() . '/channel/' . $x);
goaway(chanlink_url($goaway));}
// If we STILL haven't got anything, send them to their own profile, or the front page
goaway($a->get_baseurl());
} }