Skip to content

Commit

Permalink
small rename
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed May 30, 2024
1 parent eb7ae80 commit 19ca0ef
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Sources/XMTPiOS/Contacts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public actor Contacts {
try await consentList.publish(entries: entries)
}

public func allowGroup(groupIds: [Data]) async throws {
public func allowGroups(groupIds: [Data]) async throws {
var entries: [ConsentListEntry] = []

try await withThrowingTaskGroup(of: ConsentListEntry.self) { group in
Expand All @@ -344,7 +344,7 @@ public actor Contacts {
try await consentList.publish(entries: entries)
}

public func denyGroup(groupIds: [Data]) async throws {
public func denyGroups(groupIds: [Data]) async throws {
var entries: [ConsentListEntry] = []

try await withThrowingTaskGroup(of: ConsentListEntry.self) { group in
Expand All @@ -361,7 +361,7 @@ public actor Contacts {
try await consentList.publish(entries: entries)
}

public func allowInbox(inboxIds: [String]) async throws {
public func allowInboxes(inboxIds: [String]) async throws {
var entries: [ConsentListEntry] = []

try await withThrowingTaskGroup(of: ConsentListEntry.self) { group in
Expand All @@ -378,7 +378,7 @@ public actor Contacts {
try await consentList.publish(entries: entries)
}

public func denyInbox(inboxIds: [String]) async throws {
public func denyInboxes(inboxIds: [String]) async throws {
var entries: [ConsentListEntry] = []

try await withThrowingTaskGroup(of: ConsentListEntry.self) { group in
Expand Down
6 changes: 3 additions & 3 deletions Sources/XMTPiOS/Conversations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public actor Conversations {

let group = try await v3Client.conversations().createGroup(accountAddresses: addresses, permissions: permissions).fromFFI(client: client)

try await client.contacts.allowGroup(groupIds: [group.id])
try await client.contacts.allowGroups(groupIds: [group.id])

return group
}
Expand Down Expand Up @@ -433,12 +433,12 @@ public actor Conversations {
})?.value
}

public func fromWelcome(envelopeBytes: Data) throws -> Group? {
public func fromWelcome(envelopeBytes: Data) async throws -> Group? {
guard let v3Client = client.v3Client else {
return nil
}

let group = try v3Client.conversations().processStreamedWelcomeMessage(envelopeBytes: envelopeBytes)
let group = try await v3Client.conversations().processStreamedWelcomeMessage(envelopeBytes: envelopeBytes)
return Group(ffiGroup: group, client: client)
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/XMTPiOS/Group.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public struct Group: Identifiable, Equatable, Hashable {
let groupState = await client.contacts.consentList.groupState(groupId: id)

if groupState == ConsentState.unknown {
try await client.contacts.allowGroup(groupIds: [id])
try await client.contacts.allowGroups(groupIds: [id])
}

let messageId = try await ffiGroup.send(contentBytes: encodedContent.serializedData())
Expand Down
4 changes: 2 additions & 2 deletions Tests/XMTPTests/GroupTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -682,14 +682,14 @@ class GroupTests: XCTestCase {
XCTAssert(!isAllowed)
XCTAssert(!isDenied)

try await fixtures.bobClient.contacts.allowInbox(inboxIds: [fixtures.aliceClient.inboxID])
try await fixtures.bobClient.contacts.allowInboxes(inboxIds: [fixtures.aliceClient.inboxID])

let isAllowed2 = await fixtures.bobClient.contacts.isInboxAllowed(inboxId: fixtures.aliceClient.inboxID)
let isDenied2 = await fixtures.bobClient.contacts.isInboxDenied(inboxId: fixtures.aliceClient.inboxID)
XCTAssert(isAllowed2)
XCTAssert(!isDenied2)

try await fixtures.bobClient.contacts.denyInbox(inboxIds: [fixtures.aliceClient.inboxID])
try await fixtures.bobClient.contacts.denyInboxes(inboxIds: [fixtures.aliceClient.inboxID])

let isAllowed3 = await fixtures.bobClient.contacts.isInboxAllowed(inboxId: fixtures.aliceClient.inboxID)
let isDenied3 = await fixtures.bobClient.contacts.isInboxDenied(inboxId: fixtures.aliceClient.inboxID)
Expand Down

0 comments on commit 19ca0ef

Please sign in to comment.