mirror of
https://github.com/smolgrrr/TAO.git
synced 2024-09-20 09:21:25 +00:00
add censorship
This commit is contained in:
parent
f6ac34b451
commit
af9d99b8ee
@ -6,6 +6,7 @@ export interface UploadResult {
|
||||
error?: string;
|
||||
}
|
||||
|
||||
const whitelistImageURL = ["nostr.build", "void.cat", "blossom.oxtr"];
|
||||
/**
|
||||
* Upload file to void.cat
|
||||
* https://void.cat/swagger/index.html
|
||||
@ -64,7 +65,7 @@ export const renderMedia = (files: string[]) => {
|
||||
<div style={{ display: 'grid', gridTemplateColumns, gridTemplateRows, gap: '2px' }}>
|
||||
{files.map((file, index) => {
|
||||
// Check if the file is from allowed domains
|
||||
const isFromAllowedDomain = file.includes("i.nostr.build") || file.includes("void.cat");
|
||||
const isFromAllowedDomain = whitelistImageURL.some(domain => file.includes(domain));
|
||||
|
||||
if (file && (file.endsWith(".mp4") || file.endsWith(".webm"))) {
|
||||
return (
|
||||
|
@ -11,6 +11,8 @@ type Subscribe = {
|
||||
unsub?: boolean;
|
||||
};
|
||||
|
||||
const blacklistUrl = ["lain.la", "casualcrypto.date"];
|
||||
|
||||
const subList: Array<Subscription> = [];
|
||||
const currentSubList: Array<Subscribe> = [];
|
||||
const relayMap = new Map<string, Relay>();
|
||||
@ -40,7 +42,9 @@ const subscribe = (
|
||||
) => {
|
||||
const sub = relay.subscribe([filter], {
|
||||
onevent(event) {
|
||||
if (!blacklistUrl.some(blacklistedUrl => event.content.includes(blacklistedUrl))) {
|
||||
cb(event, relay.url);
|
||||
}
|
||||
},
|
||||
});
|
||||
subList.push(sub);
|
||||
|
Loading…
Reference in New Issue
Block a user