Cleanup, add mod
This commit is contained in:
@@ -34,7 +34,7 @@ async function getGeolocation(): Promise<Device['geolocation']> {
|
|||||||
throw new Error(`geolocation: lookup failed ${res.status}`)
|
throw new Error(`geolocation: lookup failed ${res.status}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const json = {country_code: 'US'} // await res.json()
|
const json = {country_code: 'BR'} // await res.json()
|
||||||
|
|
||||||
if (json.country_code) {
|
if (json.country_code) {
|
||||||
return {
|
return {
|
||||||
@@ -112,11 +112,11 @@ export async function ensureGeolocationResolved() {
|
|||||||
|
|
||||||
const cached = device.get(['geolocation'])
|
const cached = device.get(['geolocation'])
|
||||||
if (cached) {
|
if (cached) {
|
||||||
logger.info(`geolocation: using cache`, {cached})
|
logger.debug(`geolocation: using cache`, {cached})
|
||||||
} else {
|
} else {
|
||||||
logger.info(`geolocation: no cache`)
|
logger.debug(`geolocation: no cache`)
|
||||||
await geolocationResolution
|
await geolocationResolution
|
||||||
logger.info(`geolocation: resolved`, {
|
logger.debug(`geolocation: resolved`, {
|
||||||
resolved: device.get(['geolocation']),
|
resolved: device.get(['geolocation']),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,16 +3,16 @@ import {BskyAgent} from '@atproto/api'
|
|||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {device} from '#/storage'
|
import {device} from '#/storage'
|
||||||
|
|
||||||
export const ADDITIONAL_LABELER = 'did:plc:oz5zavafp7szpd2yyko57ccz'
|
export const BR_LABELER = 'did:plc:ekitcvx7uwnauoqy5oest3hm'
|
||||||
export const ADDITIONAL_LABELERS_MAP: {
|
export const ADDITIONAL_LABELERS_MAP: {
|
||||||
[countryCode: string]: string[]
|
[countryCode: string]: string[]
|
||||||
} = {
|
} = {
|
||||||
US: [ADDITIONAL_LABELER],
|
BR: [BR_LABELER],
|
||||||
}
|
}
|
||||||
export const ALL_ADDITIONAL_LABELERS = Object.values(
|
export const ALL_ADDITIONAL_LABELERS = Object.values(
|
||||||
ADDITIONAL_LABELERS_MAP,
|
ADDITIONAL_LABELERS_MAP,
|
||||||
).flat()
|
).flat()
|
||||||
export const NON_CONFIGURABLE_LABELERS = [ADDITIONAL_LABELER]
|
export const NON_CONFIGURABLE_LABELERS = [BR_LABELER]
|
||||||
|
|
||||||
export function isNonConfigurableModerationAuthority(did: string) {
|
export function isNonConfigurableModerationAuthority(did: string) {
|
||||||
return NON_CONFIGURABLE_LABELERS.includes(did)
|
return NON_CONFIGURABLE_LABELERS.includes(did)
|
||||||
@@ -32,7 +32,7 @@ export function configureAdditionalModerationAuthorities() {
|
|||||||
new Set([...BskyAgent.appLabelers, ...additionalLabelers]),
|
new Set([...BskyAgent.appLabelers, ...additionalLabelers]),
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.debug(`applying mod authorities`, {
|
logger.info(`applying mod authorities`, {
|
||||||
additionalLabelers,
|
additionalLabelers,
|
||||||
appLabelers,
|
appLabelers,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user