Skip to content

Commit

Permalink
add iOS side of the feature
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed May 30, 2024
1 parent b10c007 commit f35e048
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions ios/XMTPModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,34 @@ public class XMTPModule: Module {
}
try await client.contacts.allow(addresses: addresses)
}

AsyncFunction("isInboxAllowed") { (clientAddress: String, inboxId: String) -> Bool in
guard let client = await clientsManager.getClient(key: clientAddress) else {
throw Error.noClient
}
return await client.contacts.isInboxIdAllowed(inboxId: inboxId)
}

AsyncFunction("isInboxDenied") { (clientAddress: String, inboxId: String) -> Bool in
guard let client = await clientsManager.getClient(key: clientAddress) else {
throw Error.noClient
}
return await client.contacts.isInboxIdDenied(inboxId: inboxId)
}

AsyncFunction("denyInboxes") { (clientAddress: String, inboxIds: [String]) in
guard let client = await clientsManager.getClient(key: clientAddress) else {
throw Error.noClient
}
try await client.contacts.denyInboxId(inboxIds: inboxIds)
}

AsyncFunction("allowInboxes") { (clientAddress: String, inboxIds: [String]) in
guard let client = await clientsManager.getClient(key: clientAddress) else {
throw Error.noClient
}
try await client.contacts.allowInboxId(inboxIds: inboxIds)
}

AsyncFunction("refreshConsentList") { (clientAddress: String) -> [String] in
guard let client = await clientsManager.getClient(key: clientAddress) else {
Expand Down

0 comments on commit f35e048

Please sign in to comment.