diff --git a/Sources/XMTPiOS/ConversationV2.swift b/Sources/XMTPiOS/ConversationV2.swift index 947a64f6..6274dd78 100644 --- a/Sources/XMTPiOS/ConversationV2.swift +++ b/Sources/XMTPiOS/ConversationV2.swift @@ -85,8 +85,7 @@ public struct ConversationV2 { content: encodedContent, topic: topic, keyMaterial: keyMaterial, - codec: codec, - shouldPush: options?.shouldPush + codec: codec ) let topic = options?.ephemeral == true ? ephemeralTopic : topic diff --git a/Sources/XMTPiOS/Messages/DecryptedMessage.swift b/Sources/XMTPiOS/Messages/DecryptedMessage.swift index 481cf849..2109b5b0 100644 --- a/Sources/XMTPiOS/Messages/DecryptedMessage.swift +++ b/Sources/XMTPiOS/Messages/DecryptedMessage.swift @@ -13,5 +13,4 @@ public struct DecryptedMessage { public var senderAddress: String public var sentAt: Date public var topic: String = "" - public var shouldPush: Bool? } diff --git a/Sources/XMTPiOS/Messages/MessageV2.swift b/Sources/XMTPiOS/Messages/MessageV2.swift index c49114bd..5978caf9 100644 --- a/Sources/XMTPiOS/Messages/MessageV2.swift +++ b/Sources/XMTPiOS/Messages/MessageV2.swift @@ -58,8 +58,7 @@ extension MessageV2 { encodedContent: encodedMessage, senderAddress: try signed.sender.walletAddress, sentAt: Date(timeIntervalSince1970: Double(header.createdNs / 1_000_000) / 1000), - topic: topic, - shouldPush: message.shouldPush + topic: topic ) } @@ -81,7 +80,7 @@ extension MessageV2 { } } - static func encode(client: Client, content encodedContent: EncodedContent, topic: String, keyMaterial: Data, codec: Codec, shouldPush: Bool? = nil) async throws -> MessageV2 { + static func encode(client: Client, content encodedContent: EncodedContent, topic: String, keyMaterial: Data, codec: Codec) async throws -> MessageV2 { let payload = try encodedContent.serializedData() let date = Date() @@ -108,13 +107,14 @@ extension MessageV2 { let senderHmac = try Crypto.generateHmacSignature(secret: keyMaterial, info: infoEncoded, message: headerBytes) let decoded = try codec.decode(content: encodedContent, client: client) - let calculatedShouldPush = try codec.shouldPush(content: decoded) + let shouldPush = try codec.shouldPush(content: decoded) + return MessageV2( headerBytes: headerBytes, ciphertext: ciphertext, senderHmac: senderHmac, - shouldPush: shouldPush ?? calculatedShouldPush + shouldPush: shouldPush ) } } diff --git a/Sources/XMTPiOS/SendOptions.swift b/Sources/XMTPiOS/SendOptions.swift index 50c6ece6..15b09c0d 100644 --- a/Sources/XMTPiOS/SendOptions.swift +++ b/Sources/XMTPiOS/SendOptions.swift @@ -11,12 +11,10 @@ public struct SendOptions { public var compression: EncodedContentCompression? public var contentType: ContentTypeID? public var ephemeral: Bool = false - public var shouldPush: Bool? - public init(compression: EncodedContentCompression? = nil, contentType: ContentTypeID? = nil, ephemeral: Bool = false, __shouldPush: Bool? = nil) { + public init(compression: EncodedContentCompression? = nil, contentType: ContentTypeID? = nil, ephemeral: Bool = false) { self.compression = compression self.contentType = contentType self.ephemeral = ephemeral - self.shouldPush = __shouldPush } } diff --git a/XMTPiOSExample/XMTPiOSExample/Views/LoginView.swift b/XMTPiOSExample/XMTPiOSExample/Views/LoginView.swift index 9a779009..38f46ad0 100644 --- a/XMTPiOSExample/XMTPiOSExample/Views/LoginView.swift +++ b/XMTPiOSExample/XMTPiOSExample/Views/LoginView.swift @@ -128,11 +128,7 @@ struct LoginView: View { name: "XMTP Chat", description: "It's a chat app.", url: "https://localhost:4567", - icons: [], - redirect: AppMetadata.Redirect( - native: "", - universal: nil - ) + icons: [] ) )