From 093ab7177ad19459438579d608dad89cf68d4378 Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 10 Nov 2012 23:26:12 -0800 Subject: rework a couple of zot basics --- mod/_well_known.php | 2 +- mod/post.php | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'mod') diff --git a/mod/_well_known.php b/mod/_well_known.php index ac4eb6076..5c5f6585f 100644 --- a/mod/_well_known.php +++ b/mod/_well_known.php @@ -9,7 +9,7 @@ function _well_known_init(&$a){ hostxrd_init($a); break; - case 'zot-guid': + case 'zot-info': $a->argc -= 1; array_shift($a->argv); $a->argv[0] = 'zfinger'; diff --git a/mod/post.php b/mod/post.php index ef94c9b5d..fb8885b93 100644 --- a/mod/post.php +++ b/mod/post.php @@ -11,12 +11,16 @@ function post_post(&$a) { $ret = array('result' => false, 'message' => ''); - $msgtype = ((x($_REQUEST,'type')) ? $_REQUEST['type'] : ''); + $msgtype = ((array_key_exists('type',$_REQUEST)) ? $_REQUEST['type'] : ''); - $hub = zot_gethub($_REQUEST); + if(array_key_exists('sender',$_REQUEST)) { + $j_sender = json_decode($_REQUEST['sender']); + } + + $hub = zot_gethub($j_sender); if(! $hub) { - $result = zot_register_hub($_REQUEST); - if((! $result) || (! zot_gethub($_REQUEST))) { + $result = zot_register_hub($j_sender); + if((! $result['success']) || (! zot_gethub($j_sender))) { $ret['message'] = 'Hub not available.'; json_return_and_die($ret); } -- cgit v1.2.3