Skip to content

Commit

Permalink
fix: do topic work on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Apr 18, 2024
1 parent 81322d3 commit b11a74f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ios/Wrappers/GroupWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct GroupWrapper {
"createdAt": UInt64(group.createdAt.timeIntervalSince1970 * 1000),
"peerAddresses": XMTP.Conversation.group(group).peerAddresses,
"version": "GROUP",
"topic": group.id.toHex,
"topic": group.topic,
"permissionLevel": permissionString,
"adminAddress": try group.adminAddress()
]
Expand Down
7 changes: 7 additions & 0 deletions ios/XMTPModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,13 @@ public class XMTPModule: Module {
}
return ConsentWrapper.consentStateToString(state: await conversation.consentState())
}

AsyncFunction("groupConsentState") { (clientAddress: String, groupId: String) -> String in
guard let group = try await findGroup(clientAddress: clientAddress, id: groupId) else {
throw Error.conversationNotFound("no group found for \(groupId)")
}
return ConsentWrapper.consentStateToString(state: await XMTP.Conversation.group(group).consentState())
}

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

0 comments on commit b11a74f

Please sign in to comment.