adjust blocking logic

update broken dependencies
This commit is contained in:
Niko Storni 2024-12-12 17:52:40 +01:00
parent 4065389798
commit 12ba1b1aaa
3 changed files with 1142 additions and 2064 deletions

View file

@ -6,12 +6,12 @@
"license": "MIT",
"require": {
"php": ">=5.6",
"cakephp/cakephp": "3.7.7",
"cakephp/cakephp": "4.4.10",
"mobiledetect/mobiledetectlib": "2.*",
"cakephp/migrations": "~1.0",
"cakephp/migrations": "^3.0",
"psr/simple-cache": "^1.0.0",
"cakephp/plugin-installer": "~1.0",
"mdanter/ecc": "^0.5.0",
"mdanter/ecc": "1.0.0.0",
"nesbot/carbon": "~1.18",
"predis/predis": "^1.1.1",
"endroid/qr-code": "^3.5"

3190
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -31,7 +31,7 @@ class MainController extends AppController {
const tagReceiptAddress = 'bLockNgmfvnnnZw7bM6SPz6hk5BVzhevEp';
const blockedListUrl = 'https://api.odysee.com/file/list_blocked';
const blockedListUrl = 'https://api.odysee.com/file/list_blocked?with_claim_id=true';
protected $redis;
@ -976,19 +976,19 @@ class MainController extends AppController {
}
$blockedOutpoints = $blockedList->data->outpoints;
$blockedClaims = $blockedList->data;
$claimIsBlocked = false;
foreach ($blockedOutpoints as $outpoint) {
foreach ($blockedClaims as $blockedClaim) {
// $parts[0] = txid
// $parts[1] = vout
$parts = explode(':', $outpoint);
if ($claim->transaction_hash_id == $parts[0] && $claim->vout == $parts[1]) {
if ($claim->claim_id == $blockedClaim->claim_id) {
$claimIsBlocked = true;
break;
}
// check if the publisher (channel) is blocked
// block the channel if that's the case
if ($claimChannel && $claimChannel->transaction_hash_id == $parts[0] && $claimChannel->vout == $parts[1]) {
if ($claimChannel && $claimChannel->claim_id == $blockedClaim->claim_id) {
$claimIsBlocked = true;
break;
}