Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Configure moderation

+67 -12
+67 -12
src/state/session/additional-moderation-authorities.ts
··· 3 3 import {logger} from '#/logger' 4 4 import {device} from '#/storage' 5 5 6 - export const BR_LABELER = 'did:plc:ekitcvx7uwnauoqy5oest3hm' 7 - export const DE_LABELER = 'did:plc:r55ow3tocux5kafs5dq445fy' 8 - export const ADDITIONAL_LABELERS_MAP: { 6 + export const BR_LABELER = 'did:plc:ekitcvx7uwnauoqy5oest3hm' // Brazil 7 + export const DE_LABELER = 'did:plc:r55ow3tocux5kafs5dq445fy' // Germany 8 + export const RU_LABELER = 'did:plc:crm2agcxvvlj6hilnjdc4hox' // Russia 9 + export const UK_LABELER = 'did:plc:gvkp7euswjjrctjmqwhhfzif' // United Kingdom 10 + export const AU_LABELER = 'did:plc:dsynw7isrf2eqlhcjx3ffnmt' // Australia 11 + export const TR_LABELER = 'did:plc:cquoj7aozvmkud2gifeinkda' // Turkey 12 + export const JP_LABELER = 'did:plc:vhgppeyjwgrr37vm4v6ggd5a' // Japan 13 + export const ES_LABELER = 'did:plc:zlbbuj5nov4ixhvgl3bj47em' // Spain 14 + export const PK_LABELER = 'did:plc:zrp6a3tvprrsgawsbswbxu7m' // Pakistan 15 + export const IN_LABELER = 'did:plc:srr4rdvgzkbx6t7fxqtt6j5t' // India 16 + 17 + /** 18 + * For all EU countries 19 + */ 20 + export const EU_LABELER = 'did:plc:z57lz5dhgz2dkjogoysm3vut' 21 + 22 + const MODERATION_AUTHORITIES: { 9 23 [countryCode: string]: string[] 10 24 } = { 11 - BR: [BR_LABELER], 12 - DE: [DE_LABELER], 25 + BR: [BR_LABELER], // Brazil 26 + RU: [RU_LABELER], // Russia 27 + UK: [UK_LABELER], // United Kingdom 28 + AU: [AU_LABELER], // Australia 29 + TR: [TR_LABELER], // Turkey 30 + JP: [JP_LABELER], // Japan 31 + PK: [PK_LABELER], // Pakistan 32 + IN: [IN_LABELER], // India 33 + 34 + // EU countries 35 + AT: [EU_LABELER], // Austria 36 + BE: [EU_LABELER], // Belgium 37 + BG: [EU_LABELER], // Bulgaria 38 + HR: [EU_LABELER], // Croatia 39 + CY: [EU_LABELER], // Cyprus 40 + CZ: [EU_LABELER], // Czech Republic 41 + DK: [EU_LABELER], // Denmark 42 + EE: [EU_LABELER], // Estonia 43 + FI: [EU_LABELER], // Finland 44 + FR: [EU_LABELER], // France 45 + DE: [EU_LABELER, DE_LABELER], // Germany 46 + GR: [EU_LABELER], // Greece 47 + HU: [EU_LABELER], // Hungary 48 + IE: [EU_LABELER], // Ireland 49 + IT: [EU_LABELER], // Italy 50 + LV: [EU_LABELER], // Latvia 51 + LT: [EU_LABELER], // Lithuania 52 + LU: [EU_LABELER], // Luxembourg 53 + MT: [EU_LABELER], // Malta 54 + NL: [EU_LABELER], // Netherlands 55 + PL: [EU_LABELER], // Poland 56 + PT: [EU_LABELER], // Portugal 57 + RO: [EU_LABELER], // Romania 58 + SK: [EU_LABELER], // Slovakia 59 + SI: [EU_LABELER], // Slovenia 60 + ES: [EU_LABELER, ES_LABELER], // Spain 61 + SE: [EU_LABELER], // Sweden 13 62 } 14 - export const ALL_ADDITIONAL_LABELERS = Object.values( 15 - ADDITIONAL_LABELERS_MAP, 16 - ).flat() 17 - export const NON_CONFIGURABLE_LABELERS = [BR_LABELER, DE_LABELER] 63 + 64 + const MODERATION_AUTHORITIES_DIDS = Array.from( 65 + new Set(Object.values(MODERATION_AUTHORITIES).flat()), 66 + ) 18 67 19 68 export function isNonConfigurableModerationAuthority(did: string) { 20 - return NON_CONFIGURABLE_LABELERS.includes(did) 69 + return MODERATION_AUTHORITIES_DIDS.includes(did) 21 70 } 22 71 23 72 export function configureAdditionalModerationAuthorities() { 24 73 const geolocation = device.get(['geolocation']) 25 - let additionalLabelers: string[] = ALL_ADDITIONAL_LABELERS 74 + // default to all 75 + let additionalLabelers: string[] = MODERATION_AUTHORITIES_DIDS 26 76 27 77 if (geolocation?.countryCode) { 28 - additionalLabelers = ADDITIONAL_LABELERS_MAP[geolocation.countryCode] ?? [] 78 + // overwrite with only those necessary 79 + additionalLabelers = MODERATION_AUTHORITIES[geolocation.countryCode] ?? [] 29 80 } else { 30 81 logger.info(`no geolocation, cannot apply mod authorities`) 82 + } 83 + 84 + if (__DEV__) { 85 + additionalLabelers = [] 31 86 } 32 87 33 88 const appLabelers = Array.from(