8 require_once('include/salmon.php');
9 require_once('include/crypto.php');
10 require_once('include/diaspora.php');
13 function receive_post(&$a) {
15 if($a->argc != 3 || $a->argv[1] !== 'users')
16 http_status_exit(500);
20 $r = q("SELECT * FROM `user` WHERE `guid` = '%s' LIMIT 1",
24 http_status_exit(500);
28 // It is an application/x-www-form-urlencoded
30 $xml = urldecode($_POST['xml']);
32 logger('mod-diaspora: new salmon ' . $xml, LOGGER_DATA);
35 http_status_exit(500);
37 $msg = diaspora_decode($importer,$xml);
39 logger('mod-diaspora: decoded msg: ' . print_r($msg,true), LOGGER_DATA);
42 http_status_exit(500);
44 diaspora_dispatch($importer,$msg);
46 http_status_exit(200);