]> git.mxchange.org Git - friendica.git/blobdiff - src/Console/GlobalCommunitySilence.php
Move server domain pattern blocklist features to its own class
[friendica.git] / src / Console / GlobalCommunitySilence.php
index bb381d99ae828f6ada412903b7ac03ea54f20501..89674efd39f64249f9f5d87e6d3e8ae3b29ac32a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -50,7 +50,7 @@ class GlobalCommunitySilence extends \Asika\SimpleConsole\Console
        protected function getHelp()
        {
                $help = <<<HELP
-console globalcommunitysilence - Silence remote profile from global community page
+console globalcommunitysilence - Silence a profile from the global community page
 Usage
        bin/console globalcommunitysilence <profile_url> [-h|--help|-?] [-v]
 
@@ -75,7 +75,7 @@ HELP;
                $this->dba  =$dba;
        }
 
-       protected function doExecute()
+       protected function doExecute(): int
        {
                if ($this->getOption('v')) {
                        $this->out('Class: ' . __CLASS__);
@@ -98,7 +98,7 @@ HELP;
 
                $contact_id = Contact::getIdForURL($this->getArgument(0));
                if ($contact_id) {
-                       $this->dba->update('contact', ['hidden' => true], ['id' => $contact_id]);
+                       Contact::update(['hidden' => true], ['id' => $contact_id]);
                        $this->out('The account has been successfully silenced from the global community page.');
                } else {
                        throw new RuntimeException('Could not find any public contact entry for this URL (' . $this->getArgument(0) . ')');