1
1
Fork 0

Review update

Rename function, move others
This commit is contained in:
Adam Magness 2018-01-27 11:13:41 -05:00
commit f04d40a37e
55 changed files with 331 additions and 326 deletions

View file

@ -49,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);
Network::xmlStatus(3, 'Could not match challenge');
Network::xmlExit(3, 'Could not match challenge');
}
$r = q("DELETE FROM `challenge` WHERE `dfrn-id` = '%s' AND `challenge` = '%s'",
@ -71,7 +71,7 @@ function dfrn_notify_post(App $a) {
$sql_extra = sprintf(" AND `dfrn-id` = '%s' AND `duplex` = 1 ", dbesc($dfrn_id));
break;
default:
Network::xmlStatus(3, 'Invalid direction');
Network::xmlExit(3, 'Invalid direction');
break; // NOTREACHED
}
@ -97,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);
Network::xmlStatus(3, 'Contact not found');
Network::xmlExit(3, 'Contact not found');
//NOTREACHED
}
@ -123,7 +123,7 @@ function dfrn_notify_post(App $a) {
// if contact's ssl policy changed, update our links
Network::fixContactSslPolicy($importer, $ssl_policy);
$importer = Contact::updateSslPolicy($importer, $ssl_policy);
logger('dfrn_notify: received notify from ' . $importer['name'] . ' for ' . $importer['username']);
logger('dfrn_notify: data: ' . $data, LOGGER_DATA);
@ -132,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']);
Network::xmlStatus(0, 'relationship dissolved');
Network::xmlExit(0, 'relationship dissolved');
}
$rino = Config::get('system', 'rino_encrypt');
@ -146,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'");
Network::xmlStatus(0, "rino version '$rino_remote' is lower than supported '$rino'");
Network::xmlExit(0, "rino version '$rino_remote' is lower than supported '$rino'");
}
$rawkey = hex2bin(trim($key));
@ -176,14 +176,14 @@ function dfrn_notify_post(App $a) {
break;
default:
logger("rino: invalid sent version '$rino_remote'");
Network::xmlStatus(0, "Invalid sent version '$rino_remote'");
Network::xmlExit(0, "Invalid sent version '$rino_remote'");
}
logger('rino: decrypted data: ' . $data, LOGGER_DATA);
}
$ret = DFRN::import($data, $importer);
Network::xmlStatus($ret, 'Processed');
Network::xmlExit($ret, 'Processed');
// NOTREACHED
}