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", "license": "MIT",
"require": { "require": {
"php": ">=5.6", "php": ">=5.6",
"cakephp/cakephp": "3.7.7", "cakephp/cakephp": "4.4.10",
"mobiledetect/mobiledetectlib": "2.*", "mobiledetect/mobiledetectlib": "2.*",
"cakephp/migrations": "~1.0", "cakephp/migrations": "^3.0",
"psr/simple-cache": "^1.0.0", "psr/simple-cache": "^1.0.0",
"cakephp/plugin-installer": "~1.0", "cakephp/plugin-installer": "~1.0",
"mdanter/ecc": "^0.5.0", "mdanter/ecc": "1.0.0.0",
"nesbot/carbon": "~1.18", "nesbot/carbon": "~1.18",
"predis/predis": "^1.1.1", "predis/predis": "^1.1.1",
"endroid/qr-code": "^3.5" "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 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; protected $redis;
@ -976,19 +976,19 @@ class MainController extends AppController {
} }
$blockedOutpoints = $blockedList->data->outpoints; $blockedOutpoints = $blockedList->data->outpoints;
$blockedClaims = $blockedList->data;
$claimIsBlocked = false; $claimIsBlocked = false;
foreach ($blockedOutpoints as $outpoint) { foreach ($blockedClaims as $blockedClaim) {
// $parts[0] = txid // $parts[0] = txid
// $parts[1] = vout // $parts[1] = vout
$parts = explode(':', $outpoint); if ($claim->claim_id == $blockedClaim->claim_id) {
if ($claim->transaction_hash_id == $parts[0] && $claim->vout == $parts[1]) {
$claimIsBlocked = true; $claimIsBlocked = true;
break; break;
} }
// check if the publisher (channel) is blocked // check if the publisher (channel) is blocked
// block the channel if that's the case // 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; $claimIsBlocked = true;
break; break;
} }