1
1
Fork 0

Move xml_status and http_status_exit

move functions
This commit is contained in:
Adam Magness 2018-01-26 23:37:55 -05:00
commit cd3643d174
18 changed files with 87 additions and 85 deletions

View file

@ -11,6 +11,7 @@ use Friendica\Core\Config;
use Friendica\Database\DBM;
use Friendica\Model\Contact;
use Friendica\Protocol\DFRN;
use Friendica\Util\Network;
require_once 'include/items.php';
require_once 'include/event.php';
@ -48,7 +49,7 @@ function dfrn_notify_post(App $a) {
);
if (! DBM::is_result($r)) {
logger('dfrn_notify: could not match challenge to dfrn_id ' . $dfrn_id . ' challenge=' . $challenge);
xml_status(3, 'Could not match challenge');
Network::xmlStatus(3, 'Could not match challenge');
}
$r = q("DELETE FROM `challenge` WHERE `dfrn-id` = '%s' AND `challenge` = '%s'",
@ -70,7 +71,7 @@ function dfrn_notify_post(App $a) {
$sql_extra = sprintf(" AND `dfrn-id` = '%s' AND `duplex` = 1 ", dbesc($dfrn_id));
break;
default:
xml_status(3, 'Invalid direction');
Network::xmlStatus(3, 'Invalid direction');
break; // NOTREACHED
}
@ -96,7 +97,7 @@ function dfrn_notify_post(App $a) {
if (! DBM::is_result($r)) {
logger('dfrn_notify: contact not found for dfrn_id ' . $dfrn_id);
xml_status(3, 'Contact not found');
Network::xmlStatus(3, 'Contact not found');
//NOTREACHED
}
@ -131,7 +132,7 @@ function dfrn_notify_post(App $a) {
// Relationship is dissolved permanently
Contact::remove($importer['id']);
logger('relationship dissolved : ' . $importer['name'] . ' dissolved ' . $importer['username']);
xml_status(0, 'relationship dissolved');
Network::xmlStatus(0, 'relationship dissolved');
}
$rino = Config::get('system', 'rino_encrypt');
@ -145,7 +146,7 @@ function dfrn_notify_post(App $a) {
// but only for $remote_rino > 1, because old code did't send rino version
if ($rino_remote > 1 && $rino < $rino_remote) {
logger("rino version '$rino_remote' is lower than supported '$rino'");
xml_status(0, "rino version '$rino_remote' is lower than supported '$rino'");
Network::xmlStatus(0, "rino version '$rino_remote' is lower than supported '$rino'");
}
$rawkey = hex2bin(trim($key));
@ -175,14 +176,14 @@ function dfrn_notify_post(App $a) {
break;
default:
logger("rino: invalid sent version '$rino_remote'");
xml_status(0, "Invalid sent version '$rino_remote'");
Network::xmlStatus(0, "Invalid sent version '$rino_remote'");
}
logger('rino: decrypted data: ' . $data, LOGGER_DATA);
}
$ret = DFRN::import($data, $importer);
xml_status($ret, 'Processed');
Network::xmlStatus($ret, 'Processed');
// NOTREACHED
}