if chanview is provided a url - always load it even if there's no xchan available on this site.

This commit is contained in:
friendica 2013-01-18 19:54:37 -08:00
parent 27ada18dc5
commit b274422867

View File

@ -26,7 +26,7 @@ function chanview_content(&$a) {
dbesc($_REQUEST['url']) dbesc($_REQUEST['url'])
); );
if(! $r) if(! $r)
$r = array(array('xchan_url' => $_REQUEST['url'])); $xchan = array(array('xchan_url' => $_REQUEST['url']));
} }
if($r) { if($r) {
$xchan = $r[0]; $xchan = $r[0];
@ -39,10 +39,15 @@ function chanview_content(&$a) {
return; return;
} }
$observer = get_observer();
$url = (($observer)
? z_root() . '/magic?f=&dest=' . $xchan['xchan_url'] . '&addr=' . $xchan['xchan_addr']
: $xchan['xchan_url']
);
$o = replace_macros(get_markup_template('chanview.tpl'),array( $o = replace_macros(get_markup_template('chanview.tpl'),array(
'$url' => $xchan['xchan_url'] '$url' => $url
// FIXME when magic auth is finished replace here and check that against the chanview page when unauthenticated any place
// '$url' => z_root() . '/magic?f=&dest=' . $xchan['xchan_url'] . '&addr=' . $xchan['xchan_addr']
)); ));
return $o; return $o;