Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove blocked and filtered reducers/selectors/actions. #7682

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions extras/lbryinc/constants/action_types.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,6 @@ export const GET_SUGGESTED_SUBSCRIPTIONS_FAIL = 'GET_SUGGESTED_SUBSCRIPTIONS_FAI
export const SUBSCRIPTION_FIRST_RUN_COMPLETED = 'SUBSCRIPTION_FIRST_RUN_COMPLETED';
export const VIEW_SUGGESTED_SUBSCRIPTIONS = 'VIEW_SUGGESTED_SUBSCRIPTIONS';

// Blacklist
export const FETCH_BLACK_LISTED_CONTENT_STARTED = 'FETCH_BLACK_LISTED_CONTENT_STARTED';
export const FETCH_BLACK_LISTED_CONTENT_COMPLETED = 'FETCH_BLACK_LISTED_CONTENT_COMPLETED';
export const FETCH_BLACK_LISTED_CONTENT_FAILED = 'FETCH_BLACK_LISTED_CONTENT_FAILED';
export const BLACK_LISTED_CONTENT_SUBSCRIBE = 'BLACK_LISTED_CONTENT_SUBSCRIBE';

// Filtered list
export const FETCH_FILTERED_CONTENT_STARTED = 'FETCH_FILTERED_CONTENT_STARTED';
export const FETCH_FILTERED_CONTENT_COMPLETED = 'FETCH_FILTERED_CONTENT_COMPLETED';
export const FETCH_FILTERED_CONTENT_FAILED = 'FETCH_FILTERED_CONTENT_FAILED';
export const FILTERED_CONTENT_SUBSCRIBE = 'FILTERED_CONTENT_SUBSCRIBE';

// Cost Info
export const FETCH_COST_INFO_STARTED = 'FETCH_COST_INFO_STARTED';
export const FETCH_COST_INFO_COMPLETED = 'FETCH_COST_INFO_COMPLETED';
Expand Down
11 changes: 0 additions & 11 deletions extras/lbryinc/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export { doTransifexUpload } from 'util/transifex-upload';
// actions
export { doGenerateAuthToken } from './redux/actions/auth';
export { doFetchCostInfoForUri } from './redux/actions/cost_info';
export { doBlackListedOutpointsSubscribe } from './redux/actions/blacklist';
export { doFilteredOutpointsSubscribe } from './redux/actions/filtered';
export { doFetchViewCount, doFetchSubCount } from './redux/actions/stats';
export {
doCheckSync,
Expand All @@ -30,8 +28,6 @@ export {
// reducers
export { authReducer } from './redux/reducers/auth';
export { costInfoReducer } from './redux/reducers/cost_info';
export { blacklistReducer } from './redux/reducers/blacklist';
export { filteredReducer } from './redux/reducers/filtered';
export { statsReducer } from './redux/reducers/stats';
export { syncReducer } from './redux/reducers/sync';

Expand All @@ -43,17 +39,10 @@ export {
selectAllCostInfoByUri,
selectFetchingCostInfo,
} from './redux/selectors/cost_info';
export {
selectBlackListedOutpoints,
selectBlacklistedOutpointMap,
} from './redux/selectors/blacklist';
export { selectFilteredOutpoints, selectFilteredOutpointMap } from './redux/selectors/filtered';
export {
selectViewCount,
selectViewCountForUri,
// makeSelectViewCountForUri, // deprecated
selectSubCountForUri,
// makeSelectSubCountForUri, // deprecated
} from './redux/selectors/stats';
export { selectBanStateForUri } from './redux/selectors/ban';
export {
Expand Down
52 changes: 0 additions & 52 deletions extras/lbryinc/redux/actions/blacklist.js

This file was deleted.

47 changes: 0 additions & 47 deletions extras/lbryinc/redux/actions/filtered.js

This file was deleted.

37 changes: 0 additions & 37 deletions extras/lbryinc/redux/reducers/blacklist.js

This file was deleted.

34 changes: 0 additions & 34 deletions extras/lbryinc/redux/reducers/filtered.js

This file was deleted.

26 changes: 1 addition & 25 deletions extras/lbryinc/redux/selectors/ban.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@ import { createCachedSelector } from 're-reselect';
import { selectClaimForUri, makeSelectIsBlacklisted } from 'redux/selectors/claims';
import { selectMutedChannels } from 'redux/selectors/blocked';
import { selectModerationBlockList } from 'redux/selectors/comments';
import { selectBlacklistedOutpointMap, selectFilteredOutpointMap } from 'lbryinc';
import { getChannelFromClaim } from 'util/claim';
import { isURIEqual } from 'util/lbryURI';

export const selectBanStateForUri = createCachedSelector(
selectClaimForUri,
selectBlacklistedOutpointMap,
selectFilteredOutpointMap,
selectMutedChannels,
selectModerationBlockList,
(state, uri) => makeSelectIsBlacklisted(uri)(state),
(claim, blackListedOutpointMap, filteredOutpointMap, mutedChannelUris, personalBlocklist, isBlacklisted) => {
(claim, mutedChannelUris, personalBlocklist, isBlacklisted) => {
const banState = {};

if (!claim) {
Expand All @@ -32,27 +29,6 @@ export const selectBanStateForUri = createCachedSelector(
banState['blacklisted'] = true;
}

// This will be replaced once blocking is done at the wallet server level.
if (blackListedOutpointMap) {
if (
(channelClaim && blackListedOutpointMap[`${channelClaim.txid}:${channelClaim.nout}`]) ||
blackListedOutpointMap[`${claim.txid}:${claim.nout}`]
) {
banState['blacklisted'] = true;
}
}

// We're checking to see if the stream outpoint or signing channel outpoint
// is in the filter list.
if (filteredOutpointMap) {
if (
(channelClaim && filteredOutpointMap[`${channelClaim.txid}:${channelClaim.nout}`]) ||
filteredOutpointMap[`${claim.txid}:${claim.nout}`]
) {
banState['filtered'] = true;
}
}

// block stream claims
// block channel claims if we can't control for them in claim search
if (mutedChannelUris.length && channelClaim) {
Expand Down
20 changes: 0 additions & 20 deletions extras/lbryinc/redux/selectors/blacklist.js

This file was deleted.

20 changes: 0 additions & 20 deletions extras/lbryinc/redux/selectors/filtered.js

This file was deleted.

1 change: 1 addition & 0 deletions flow-typed/Claim.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ declare type ClaimErrorCensor = {
take_over_height: number,
},
name: string,
text: string,
jessopb marked this conversation as resolved.
Show resolved Hide resolved
normalized_name: string,
nout: number,
permanent_url: string,
Expand Down
11 changes: 10 additions & 1 deletion flow-typed/Lbry.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,16 @@ declare type BalanceResponse = {

declare type ResolveResponse = {
// Keys are the url(s) passed to resolve
[string]: { error?: {}, stream?: StreamClaim, channel?: ChannelClaim, collection?: CollectionClaim, claimsInChannel?: number },
[string]: {
error?: {
censor?: {},
text?: string,
},
stream?: StreamClaim,
channel?: ChannelClaim,
collection?: CollectionClaim,
claimsInChannel?: number
},
};

declare type GetResponse = FileListItem & { error?: string };
Expand Down
7 changes: 0 additions & 7 deletions flow-typed/npm/lbryinc_vx.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ declare module 'lbryinc/src/redux/reducers/auth' {
declare module.exports: any;
}

declare module 'lbryinc/src/redux/reducers/blacklist' {
declare module.exports: any;
}

declare module 'lbryinc/src/redux/reducers/cost_info' {
declare module.exports: any;
}
Expand Down Expand Up @@ -212,9 +208,6 @@ declare module 'lbryinc/src/redux/actions/user.js' {
declare module 'lbryinc/src/redux/reducers/auth.js' {
declare module.exports: $Exports<'lbryinc/src/redux/reducers/auth'>;
}
declare module 'lbryinc/src/redux/reducers/blacklist.js' {
declare module.exports: $Exports<'lbryinc/src/redux/reducers/blacklist'>;
}
declare module 'lbryinc/src/redux/reducers/cost_info.js' {
declare module.exports: $Exports<'lbryinc/src/redux/reducers/cost_info'>;
}
Expand Down
3 changes: 3 additions & 0 deletions static/app-strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2319,5 +2319,8 @@
"Your hub has blocked this content because it subscribes to the following blocking channel:": "Your hub has blocked this content because it subscribes to the following blocking channel:",
"Your hub has blocked access to this content do to a complaint received under the US Digital Millennium Copyright Act.": "Your hub has blocked access to this content do to a complaint received under the US Digital Millennium Copyright Act.",
"Autoplay Next is on.": "Autoplay Next is on.",
"Content Blocked": "Content Blocked",
"Your hub has blocked %content% because it subscribes to the following blocking channel:": "Your hub has blocked %content% because it subscribes to the following blocking channel:",
"Your hub has blocked %content% because it subscribes to %channel%. You can change your hub in %settings%.": "Your hub has blocked %content% because it subscribes to %channel%. You can change your hub in %settings%.",
"--end--": "--end--"
}
3 changes: 0 additions & 3 deletions ui/component/collectionPreviewTile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
import { doFetchItemsInCollection, doCollectionDelete } from 'redux/actions/collections';
import { doResolveUri } from 'redux/actions/claims';
import { selectMutedChannels } from 'redux/selectors/blocked';
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
import { selectShowMatureContent } from 'redux/selectors/settings';
import CollectionPreviewTile from './view';

Expand All @@ -42,8 +41,6 @@ const select = (state, props) => {
isResolvingUri: collectionUri && selectIsUriResolving(state, collectionUri),
thumbnail: getThumbnailFromClaim(claim),
title: collectionUri && selectTitleForUri(state, collectionUri),
blackListedOutpoints: selectBlackListedOutpoints(state),
filteredOutpoints: selectFilteredOutpoints(state),
blockedChannelUris: selectMutedChannels(state),
showMature: selectShowMatureContent(state),
isMature: makeSelectClaimIsNsfw(collectionUri)(state),
Expand Down
Loading