aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Chanview.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2016-10-26 21:50:30 -0700
committerzotlabs <mike@macgirvin.com>2016-10-26 21:50:30 -0700
commitd46fe209865d4b45bb4a27ec70744ee50a178dc7 (patch)
tree21eaa79b6569b38a88c64bea1e8ef47c5e861fa3 /Zotlabs/Module/Chanview.php
parentd42da529ece416a3d69d30eea7ded96731774a62 (diff)
downloadvolse-hubzilla-d46fe209865d4b45bb4a27ec70744ee50a178dc7.tar.gz
volse-hubzilla-d46fe209865d4b45bb4a27ec70744ee50a178dc7.tar.bz2
volse-hubzilla-d46fe209865d4b45bb4a27ec70744ee50a178dc7.zip
modernise chanview, which has a renewed purpose - to provide a connect link to foreign network members. The iframe no longer works due to content security policies, and people hated this with a passion anyway; so just provide a URL to visit.
Diffstat (limited to 'Zotlabs/Module/Chanview.php')
-rw-r--r--Zotlabs/Module/Chanview.php47
1 files changed, 32 insertions, 15 deletions
diff --git a/Zotlabs/Module/Chanview.php b/Zotlabs/Module/Chanview.php
index 9aa83efc4..01ee74d5a 100644
--- a/Zotlabs/Module/Chanview.php
+++ b/Zotlabs/Module/Chanview.php
@@ -86,6 +86,7 @@ class Chanview extends \Zotlabs\Web\Controller {
}
if(! \App::$poi) {
+
// We don't know who this is, and we can't figure it out from the URL
// On the plus side, there's a good chance we know somebody else at that
// hub so sending them there with a Zid will probably work anyway.
@@ -99,26 +100,42 @@ class Chanview extends \Zotlabs\Web\Controller {
$url = zid($url);
}
+
+ $is_zot = false;
if (\App::$poi) {
- $url = \App::$poi['xchan_url'];
- if($observer)
- $url = zid($url);
+ $url = \App::$poi['xchan_url'];
+ if(\App::$poi['xchan_network'] === 'zot') {
+ $is_zot = true;
+ }
}
- // let somebody over-ride the iframed viewport presentation
- // or let's just declare this a failed experiment.
-
- // if((! local_channel()) || (get_pconfig(local_channel(),'system','chanview_full')))
-
- goaway($url);
-
- // $o = replace_macros(get_markup_template('chanview.tpl'),array(
- // '$url' => $url,
- // '$full' => t('toggle full screen mode')
- // ));
+
+ // We will load the chanview template if it's a foreign network,
+ // just so that we can provide a connect button along with a profile
+ // photo. Chances are we can't load the remote profile into an iframe
+ // because of cross-domain security headers. So provide a link to
+ // the remote profile.
+
+ // Zot channels will usually have a connect link.
+ // If it isn't zot, 'pro' members won't be able to use the connect
+ // button as it is a foreign network so just send them to the remote
+ // profile.
+
- // return $o;
+ if($is_zot || \Zotlabs\Lib\System::get_server_role() === 'pro') {
+ if($is_zot && $observer) {
+ $url = zid($url);
+ }
+ goaway($url);
+ }
+ else {
+ $o = replace_macros(get_markup_template('chanview.tpl'),array(
+ '$url' => $url,
+ '$full' => t('toggle full screen mode')
+ ));
+ return $o;
+ }
}
}