1
1
Fork 0

Move functions to system

move some functions to system
This commit is contained in:
Adam Magness 2018-01-27 11:59:10 -05:00
commit 9b8599b619
21 changed files with 169 additions and 169 deletions

View file

@ -8,10 +8,10 @@
use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\System;
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';
@ -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::xmlExit(3, 'Could not match challenge');
System::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::xmlExit(3, 'Invalid direction');
System::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::xmlExit(3, 'Contact not found');
System::xmlExit(3, 'Contact not found');
//NOTREACHED
}
@ -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::xmlExit(0, 'relationship dissolved');
System::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::xmlExit(0, "rino version '$rino_remote' is lower than supported '$rino'");
System::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::xmlExit(0, "Invalid sent version '$rino_remote'");
System::xmlExit(0, "Invalid sent version '$rino_remote'");
}
logger('rino: decrypted data: ' . $data, LOGGER_DATA);
}
$ret = DFRN::import($data, $importer);
Network::xmlExit($ret, 'Processed');
System::xmlExit($ret, 'Processed');
// NOTREACHED
}