aboutsummaryrefslogtreecommitdiffstats
path: root/mod/post.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-08-08 18:50:04 -0700
committerfriendica <info@friendica.com>2012-08-08 18:50:04 -0700
commit9a39d4ade21af15e9d6a3aae1f467f0d173cc0de (patch)
tree569a3839709bf452b44515dc8c6d3f887f78b9dc /mod/post.php
parentc28da5673731acbedecb4209c38b72046db597e1 (diff)
downloadvolse-hubzilla-9a39d4ade21af15e9d6a3aae1f467f0d173cc0de.tar.gz
volse-hubzilla-9a39d4ade21af15e9d6a3aae1f467f0d173cc0de.tar.bz2
volse-hubzilla-9a39d4ade21af15e9d6a3aae1f467f0d173cc0de.zip
moving forward again
Diffstat (limited to 'mod/post.php')
-rw-r--r--mod/post.php44
1 files changed, 10 insertions, 34 deletions
diff --git a/mod/post.php b/mod/post.php
index 4a7e33b23..c5430d46e 100644
--- a/mod/post.php
+++ b/mod/post.php
@@ -5,47 +5,23 @@
*/
-require_once('include/salmon.php');
-require_once('include/crypto.php');
-// not yet ready for prime time
-//require_once('include/zot.php');
+require_once('include/zot.php');
function post_post(&$a) {
- $bulk_delivery = false;
+ $ret = array('result' => false, 'message' => '');
- if($a->argc == 1) {
- $bulk_delivery = true;
- }
- else {
- $nickname = $a->argv[2];
- $r = q("SELECT * FROM `user` WHERE `nickname` = '%s'
- AND `account_expired` = 0 LIMIT 1",
- dbesc($nickname)
- );
- if(! count($r))
- http_status_exit(500);
-
- $importer = $r[0];
- }
-
- $xml = file_get_contents('php://input');
-
- logger('mod-post: new zot: ' . $xml, LOGGER_DATA);
+ $msgtype = ((x($_REQUEST,'type')) ? $_REQUEST['type'] : '');
- if(! $xml)
- http_status_exit(500);
+ if($msgtype === 'notify') {
- $msg = zot_decode($importer,$xml);
+ // add to receive queue
+ // qreceive_add($_REQUEST);
- logger('mod-post: decoded msg: ' . print_r($msg,true), LOGGER_DATA);
-
- if(! is_array($msg))
- http_status_exit(500);
+ $ret['result'] = true;
+ json_return_and_die($ret);
+ }
- $ret = 0;
- $ret = zot_incoming($bulk_delivery, $importer,$msg);
- http_status_exit(($ret) ? $ret : 200);
- // NOTREACHED
}
+