8 require_once('include/salmon.php');
9 require_once('include/crypto.php');
10 require_once('include/diaspora.php');
13 function receive_post(&$a) {
17 if(($a->argc == 2) && ($a->argv[1] === 'public')) {
22 if($a->argc != 3 || $a->argv[1] !== 'users')
23 http_status_exit(500);
27 $r = q("SELECT * FROM `user` WHERE `guid` = '%s' AND `account_expired` = 0 LIMIT 1",
31 http_status_exit(500);
36 // It is an application/x-www-form-urlencoded
38 $xml = urldecode($_POST['xml']);
40 logger('mod-diaspora: new salmon ' . $xml, LOGGER_DATA);
43 http_status_exit(500);
45 $msg = diaspora_decode($importer,$xml);
47 logger('mod-diaspora: decoded msg: ' . print_r($msg,true), LOGGER_DATA);
50 http_status_exit(500);
54 diaspora_dispatch_public($msg);
56 $ret = diaspora_dispatch($importer,$msg);
58 http_status_exit(($ret) ? $ret : 200);