]> git.mxchange.org Git - friendica.git/blobdiff - include/api.php
Merge pull request #5418 from MrPetovan/task/5410-move-dba-to-src
[friendica.git] / include / api.php
index 4e8e9c2323838caec967c7686a38dfd0847825e9..a6196852bf229f6f9ed890820aae6aa7b2e0b3cc 100644 (file)
@@ -19,6 +19,7 @@ use Friendica\Core\PConfig;
 use Friendica\Core\Protocol;
 use Friendica\Core\System;
 use Friendica\Core\Worker;
+use Friendica\Database\dba;
 use Friendica\Database\DBM;
 use Friendica\Model\Contact;
 use Friendica\Model\Group;
@@ -772,6 +773,7 @@ function api_get_user(App $a, $contact_id = null)
                $theme_info = dba::selectFirst('user', ['theme'], ['uid' => $ret['uid']]);
                if ($theme_info['theme'] === 'frio') {
                        $schema = PConfig::get($ret['uid'], 'frio', 'schema');
+
                        if ($schema && ($schema != '---')) {
                                if (file_exists('view/theme/frio/schema/'.$schema.'.php')) {
                                        $schemefile = 'view/theme/frio/schema/'.$schema.'.php';
@@ -1034,7 +1036,6 @@ function api_statuses_mediap($type)
        }
        $user_info = api_get_user($a);
 
-       $_REQUEST['type'] = 'wall';
        $_REQUEST['profile_uid'] = api_user();
        $_REQUEST['api_source'] = true;
        $txt = requestdata('status');
@@ -1123,9 +1124,7 @@ function api_statuses_update($type)
        }
        $_REQUEST['profile_uid'] = api_user();
 
-       if ($parent) {
-               $_REQUEST['type'] = 'net-comment';
-       } else {
+       if (!$parent) {
                // Check for throttling (maximum posts per day, week and month)
                $throttle_day = Config::get('system', 'throttle_limit_day');
                if ($throttle_day > 0) {
@@ -1168,8 +1167,6 @@ function api_statuses_update($type)
                                throw new TooManyRequestsException(L10n::t("Monthly posting limit of %d post reached. The post was rejected.", "Monthly posting limit of %d posts reached. The post was rejected.", $throttle_month));
                        }
                }
-
-               $_REQUEST['type'] = 'wall';
        }
 
        if (x($_FILES, 'media')) {
@@ -1991,7 +1988,6 @@ function api_statuses_repeat($type)
                }
                $_REQUEST['body'] = $post;
                $_REQUEST['profile_uid'] = api_user();
-               $_REQUEST['type'] = 'wall';
                $_REQUEST['api_source'] = true;
 
                if (!x($_REQUEST, "source")) {
@@ -3344,7 +3340,7 @@ function api_statusnet_config($type)
        $server    = $a->get_hostname();
        $logo      = System::baseUrl() . '/images/friendica-64.png';
        $email     = Config::get('config', 'admin_email');
-       $closed    = Config::get('config', 'register_policy') == REGISTER_CLOSED ? 'true' : 'false';
+       $closed    = intval(Config::get('config', 'register_policy')) === REGISTER_CLOSED ? 'true' : 'false';
        $private   = Config::get('system', 'block_public') ? 'true' : 'false';
        $textlimit = (string) Config::get('config', 'api_import_size', Config::get('config', 'max_import_size', 200000));
        $ssl       = Config::get('system', 'have_ssl') ? 'true' : 'false';