diff --git a/src/Contacts.ts b/src/Contacts.ts index fcf195539..aa4d81061 100644 --- a/src/Contacts.ts +++ b/src/Contacts.ts @@ -6,7 +6,7 @@ import { fromNanoString, } from './utils' -export type ConsentState = 'allowed' | 'blocked' | 'unknown' +export type ConsentState = 'allowed' | 'denied' | 'unknown' export type ConsentListEntryType = 'address' @@ -54,9 +54,9 @@ export class ConsentList { return entry } - block(address: string) { - const entry = ConsentListEntry.fromAddress(address, 'blocked') - this.entries.set(entry.key, 'blocked') + deny(address: string) { + const entry = ConsentListEntry.fromAddress(address, 'denied') + this.entries.set(entry.key, 'denied') return entry } @@ -120,7 +120,7 @@ export class ConsentList { this.allow(address) }) action.block?.walletAddresses.forEach((address) => { - this.block(address) + this.deny(address) }) }) @@ -144,7 +144,7 @@ export class ConsentList { } : undefined, block: - entry.permissionType === 'blocked' + entry.permissionType === 'denied' ? { walletAddresses: [entry.value], } @@ -229,8 +229,8 @@ export class Contacts { if (entry.permissionType === 'allowed') { this.consentList.allow(entry.value) } - if (entry.permissionType === 'blocked') { - this.consentList.block(entry.value) + if (entry.permissionType === 'denied') { + this.consentList.deny(entry.value) } }) } @@ -239,8 +239,8 @@ export class Contacts { return this.consentList.state(address) === 'allowed' } - isBlocked(address: string) { - return this.consentList.state(address) === 'blocked' + isDenied(address: string) { + return this.consentList.state(address) === 'denied' } consentState(address: string) { @@ -255,10 +255,10 @@ export class Contacts { ) } - async block(addresses: string[]) { + async deny(addresses: string[]) { await this.consentList.publish( addresses.map((address) => - ConsentListEntry.fromAddress(address, 'blocked') + ConsentListEntry.fromAddress(address, 'denied') ) ) } diff --git a/src/conversations/Conversation.ts b/src/conversations/Conversation.ts index b1a16ce48..5c4d86bd9 100644 --- a/src/conversations/Conversation.ts +++ b/src/conversations/Conversation.ts @@ -72,18 +72,18 @@ export interface Conversation { */ allow(): Promise /** - * Add conversation peer address to block list + * Add conversation peer address to deny list */ - block(): Promise + deny(): Promise /** * Returns true if conversation peer address is on the allow list */ isAllowed: boolean /** - * Returns true if conversation peer address is on the block list + * Returns true if conversation peer address is on the deny list */ - isBlocked: boolean + isDenied: boolean /** * Returns the consent state of the conversation peer address */ @@ -191,16 +191,16 @@ export class ConversationV1 await this.client.contacts.allow([this.peerAddress]) } - async block() { - await this.client.contacts.block([this.peerAddress]) + async deny() { + await this.client.contacts.deny([this.peerAddress]) } get isAllowed() { return this.client.contacts.isAllowed(this.peerAddress) } - get isBlocked() { - return this.client.contacts.isBlocked(this.peerAddress) + get isDenied() { + return this.client.contacts.isDenied(this.peerAddress) } get consentState() { @@ -522,16 +522,16 @@ export class ConversationV2 await this.client.contacts.allow([this.peerAddress]) } - async block() { - await this.client.contacts.block([this.peerAddress]) + async deny() { + await this.client.contacts.deny([this.peerAddress]) } get isAllowed() { return this.client.contacts.isAllowed(this.peerAddress) } - get isBlocked() { - return this.client.contacts.isBlocked(this.peerAddress) + get isDenied() { + return this.client.contacts.isDenied(this.peerAddress) } get consentState() {