This repository has been archived on 2024-08-19. You can view files and clone it, but cannot push or open issues or pull requests.
Files
core/mod/post.php
2012-08-09 20:31:06 -07:00

39 lines
623 B
PHP

<?php
/**
* Zot endpoint
*/
require_once('include/zot.php');
function post_post(&$a) {
$ret = array('result' => false, 'message' => '');
$msgtype = ((x($_REQUEST,'type')) ? $_REQUEST['type'] : '');
if($msgtype === 'notify') {
$hub = zot_gethub($_REQUEST['guid']);
if(! $hub) {
$result = zot_register_hub($_REQUEST);
if(! $result) {
$ret['message'] = 'Hub not available.';
json_return_and_dir($ret);
}
}
// check which hub is primary and take action if mismatched
// add to receive queue
// qreceive_add($_REQUEST);
$ret['result'] = true;
json_return_and_die($ret);
}
}