Skip to content

Commit

Permalink
update the group
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Sep 20, 2024
1 parent 56eafba commit 0cdf452
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions Sources/XMTPiOS/Extensions/Ffi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,9 @@ extension EntryType {
}
}
}

extension ConsentListEntry {
var toFFI: FfiConsent {
FfiConsent(entityType: entryType.toFFI, state: consentType.toFFI, entity: value)
}
}
8 changes: 4 additions & 4 deletions Sources/XMTPiOS/Group.swift
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ public struct Group: Identifiable, Equatable, Hashable {
public func updateConsentState(state: ConsentState) async throws {
if (client.hasV2Client) {
switch (state) {
case .allowed: client.contacts.allowGroups(groupIds: [id])
case .denied: client.contacts.denyGroups(groupIds: [id])
case .unknown: Unit
case .allowed: try await client.contacts.allowGroups(groupIds: [id])
case .denied: try await client.contacts.denyGroups(groupIds: [id])
case .unknown: ()
}
}

try await ffiGroup.updateConsentState(state: state.toFFI)
try ffiGroup.updateConsentState(state: state.toFFI)
}

public func consentState() throws -> ConsentState{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/xmtp/libxmtp-swift.git",
"state" : {
"revision" : "9d5153926ac1bfcab76802d5a7626c2cf47212a4",
"version" : "0.5.8-beta5"
"revision" : "9398f5516b18044bb94e5d21dabd7a5ddfc25062",
"version" : "0.5.8-beta6"
}
},
{
Expand Down

0 comments on commit 0cdf452

Please sign in to comment.