From a06dd1fc375c70bf5c930180837b964988558379 Mon Sep 17 00:00:00 2001 From: nobody Date: Sat, 16 Oct 2021 14:56:36 -0700 Subject: [PATCH] allow remote connections without owa --- Zotlabs/Module/Fedi_id.php | 53 ++++++++++++++++++++++++++++++++++++++ Zotlabs/Module/Update.php | 20 ++++++++++---- include/connections.php | 2 +- view/tpl/fedi_id.tpl | 9 +++++++ 4 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 Zotlabs/Module/Fedi_id.php create mode 100644 view/tpl/fedi_id.tpl diff --git a/Zotlabs/Module/Fedi_id.php b/Zotlabs/Module/Fedi_id.php new file mode 100644 index 000000000..0b596d192 --- /dev/null +++ b/Zotlabs/Module/Fedi_id.php @@ -0,0 +1,53 @@ + t('Home instance'), + '$address' => [ 'address', t('Enter your channel address or fediverse ID (e.g. channel@example.com)'), '', '' ], + '$action' => 'fedi_id/' . argv(1), + '$method' => 'post', + '$submit' => t('Connect') + ] + ); + + } + +} \ No newline at end of file diff --git a/Zotlabs/Module/Update.php b/Zotlabs/Module/Update.php index 94ef3acdf..c83fc6b18 100644 --- a/Zotlabs/Module/Update.php +++ b/Zotlabs/Module/Update.php @@ -3,11 +3,21 @@ namespace Zotlabs\Module; /* * Update - * Performs AJAX liveUpdate of conversational content by calling the appropriate - * controller (passed as argv(1)) and passing the profile_uid (passed as $_GET['p']) - * and load flag (argv(2) === 'load') to the get() function of the controller. - * Conversational controllers have been written to expect this input. Other controllers - * have not. + * Called by main.js to load or fetch updates of content for various conversation streams/timelines. + * It invokes the appropriate module's get() function to return an array of HTML rendered conversations/posts. + * Some state is passed to the module controller prior to calling module->get() to indicate that + * the existing content should either be replaced or appended to. + * The current modules that support this manner of update are + * channel, hq, stream, display, search, and pubstream. + * The state we are passing is the profile_uid (passed to us as $_GET['p']), and argv(2) === 'load' + * to indicate that we're replacing original content. + * + * module->profile_uid - tell the module who owns this data + * module->loading - tell the module to replace existing content + * module->updating - always true to tell the module that this is a js initiated request + * + * Inside main.js we also append all of the relevant content query params which were initially used on that + * page via buildCmd so those are passed to this instance of update and are therefore available from the module. */ use App; diff --git a/include/connections.php b/include/connections.php index b2a6cdc64..fdff8b137 100644 --- a/include/connections.php +++ b/include/connections.php @@ -43,7 +43,7 @@ function abook_store_lowlevel($arr) { function rconnect_url($channel_id,$xchan) { if (! $xchan) { - return EMPTY_STR; + return z_root() . '/fedi_id/' . $channel_id; } $r = q("select abook_id from abook where abook_channel = %d and abook_xchan = '%s' limit 1", diff --git a/view/tpl/fedi_id.tpl b/view/tpl/fedi_id.tpl new file mode 100644 index 000000000..071c0ddb3 --- /dev/null +++ b/view/tpl/fedi_id.tpl @@ -0,0 +1,9 @@ +
+

{{$title}}

+
+
+ {{include file="field_input.tpl" field=$address}} + +
+
+