]> git.mxchange.org Git - friendica.git/blobdiff - mod/poco.php
Merge pull request #8227 from annando/daemon-checks
[friendica.git] / mod / poco.php
index 2ed871285b76586b38e30eb63def4c6d49816cb9..d8941e51ade5c6de1caa52d71197d6693bc06c8e 100644 (file)
@@ -6,13 +6,11 @@
 
 use Friendica\App;
 use Friendica\Content\Text\BBCode;
-use Friendica\Core\Cache;
-use Friendica\Core\Config;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
-use Friendica\Core\System;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Protocol\PortableContact;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Strings;
@@ -21,7 +19,7 @@ use Friendica\Util\XML;
 function poco_init(App $a) {
        $system_mode = false;
 
-       if (intval(Config::get('system', 'block_public')) || (Config::get('system', 'block_local_dir'))) {
+       if (intval(DI::config()->get('system', 'block_public')) || (DI::config()->get('system', 'block_local_dir'))) {
                throw new \Friendica\Network\HTTPException\ForbiddenException();
        }
 
@@ -69,7 +67,7 @@ function poco_init(App $a) {
 
        if (! $system_mode && ! $global) {
                $users = q("SELECT `user`.*,`profile`.`hide-friends` from user left join profile on `user`.`uid` = `profile`.`uid`
-                       where `user`.`nickname` = '%s' and `profile`.`is-default` = 1 limit 1",
+                       where `user`.`nickname` = '%s' limit 1",
                        DBA::escape($nickname)
                );
                if (! DBA::isResult($users) || $users[0]['hidewall'] || $users[0]['hide-friends']) {
@@ -142,7 +140,7 @@ function poco_init(App $a) {
                                `profile`.`postal-code` AS `ppostalcode`, `profile`.`country-name` AS `pcountry`, `user`.`account-type`
                        FROM `contact` INNER JOIN `profile` ON `profile`.`uid` = `contact`.`uid`
                                INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
-                       WHERE `self` = 1 AND `profile`.`is-default`
+                       WHERE `self` = 1
                        AND `contact`.`uid` IN (SELECT `uid` FROM `pconfig` WHERE `cat` = 'system' AND `k` = 'suggestme' AND `v` = 1) LIMIT %d, %d",
                        intval($startIndex),
                        intval($itemsPerPage)
@@ -255,10 +253,10 @@ function poco_init(App $a) {
                                if (isset($contact['account-type'])) {
                                        $contact['contact-type'] = $contact['account-type'];
                                }
-                               $about = Cache::get("about:" . $contact['updated'] . ":" . $contact['nurl']);
+                               $about = DI::cache()->get("about:" . $contact['updated'] . ":" . $contact['nurl']);
                                if (is_null($about)) {
                                        $about = BBCode::convert($contact['about'], false);
-                                       Cache::set("about:" . $contact['updated'] . ":" . $contact['nurl'], $about);
+                                       DI::cache()->set("about:" . $contact['updated'] . ":" . $contact['nurl'], $about);
                                }
 
                                // Non connected persons can only see the keywords of a Diaspora account