diff options
author | Mario Vavti <mario@mariovavti.com> | 2023-04-26 23:01:56 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2023-04-26 23:01:56 +0200 |
commit | bdb25315b6f01f1963b21f6e0c0bd5ec2959c62e (patch) | |
tree | e530ef64610ff7f978c36c4fe7a636c8f478c456 /Zotlabs/Module | |
parent | 60f0739c3e8158bdcb373c3607ef2e8e8fcb4e08 (diff) | |
download | volse-hubzilla-bdb25315b6f01f1963b21f6e0c0bd5ec2959c62e.tar.gz volse-hubzilla-bdb25315b6f01f1963b21f6e0c0bd5ec2959c62e.tar.bz2 volse-hubzilla-bdb25315b6f01f1963b21f6e0c0bd5ec2959c62e.zip |
initial commit for directory flags federation
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Dircensor.php | 19 | ||||
-rw-r--r-- | Zotlabs/Module/Dirsearch.php | 4 |
2 files changed, 14 insertions, 9 deletions
diff --git a/Zotlabs/Module/Dircensor.php b/Zotlabs/Module/Dircensor.php index 309b14346..90759e58d 100644 --- a/Zotlabs/Module/Dircensor.php +++ b/Zotlabs/Module/Dircensor.php @@ -4,6 +4,7 @@ namespace Zotlabs\Module; use App; use Zotlabs\Web\Controller; +use Zotlabs\Lib\Libzotdir; class Dircensor extends Controller { @@ -20,6 +21,7 @@ class Dircensor extends Controller { } $xchan = argv(1); + if(! $xchan) { return; } @@ -33,25 +35,28 @@ class Dircensor extends Controller { } $severity = intval($_REQUEST['severity'] ?? 0); + $flag = DIRECTORY_FLAG_OK; - if ($severity < 0) { - $severity = 0; + if ($severity === 1) { + $flag = DIRECTORY_FLAG_UNSAFE; } - if ($severity > 2) { - $severity = 2; + if ($severity === 2) { + $flag = DIRECTORY_FLAG_HIDDEN; } +hz_syslog('flag: '. print_r($flag, true)); + Libzotdir::update($xchan, $r[0]['xchan_url'], true, $flag); q("update xchan set xchan_censored = %d where xchan_hash = '%s'", - intval($severity), + intval($flag), dbesc($xchan) ); - if($severity) { + if($flag) { info( t('Entry censored') . EOL); } else { - info( t('Entry uncensored') . EOL); + info( t('Entry OK') . EOL); } goaway(z_root() . '/directory'); diff --git a/Zotlabs/Module/Dirsearch.php b/Zotlabs/Module/Dirsearch.php index 22b030edf..d4af0f91a 100644 --- a/Zotlabs/Module/Dirsearch.php +++ b/Zotlabs/Module/Dirsearch.php @@ -228,8 +228,8 @@ class Dirsearch extends Controller { $spkt['transactions'][] = [ 'hash' => $rr['ud_hash'], 'address' => $rr['ud_addr'], - 'host' => $rr['ud_guid'], - 'transaction_id' => $rr['ud_guid'], // deprecated 2023-04-12 + 'host' => $rr['ud_host'], + 'transaction_id' => $rr['ud_host'], // deprecated 2023-04-12 'timestamp' => $rr['ud_date'], 'flags' => $rr['ud_flags'] ]; |