Skip to content

Commit

Permalink
Revert "feat: integrate `shouldPush' for React Native (#184)"
Browse files Browse the repository at this point in the history
This reverts commit 887f1f4.
  • Loading branch information
kele-leanes committed Feb 28, 2024
1 parent 561bab0 commit c2be648
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ data class ConversationV2(
topic = topic,
keyMaterial = keyMaterial,
codec = codec,
shouldPush = options?.__shouldPush
)

val newTopic = if (options?.ephemeral == true) ephemeralTopic else topic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ import org.xmtp.proto.message.contents.Content
data class SendOptions(
var compression: EncodedContentCompression? = null,
var contentType: Content.ContentTypeId? = null,
var ephemeral: Boolean = false,
var __shouldPush: Boolean? = null
var ephemeral: Boolean = false
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ data class DecryptedMessage(
var encodedContent: EncodedContent,
var senderAddress: String,
var sentAt: Date,
var topic: String = "",
var shouldPush: Boolean? = null,
var topic: String = ""
)
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ class MessageV2Builder(val senderHmac: ByteArray? = null, val shouldPush: Boolea
topic: String,
keyMaterial: ByteArray,
codec: Codec,
shouldPush: Boolean? = null
): MessageV2Builder {
val payload = encodedContent.toByteArray()
val date = Date()
Expand All @@ -163,13 +162,12 @@ class MessageV2Builder(val senderHmac: ByteArray? = null, val shouldPush: Boolea
Crypto.deriveKey(keyMaterial, ByteArray(0), infoEncoded),
headerBytes
)
val calculatedShouldPush = shouldPush ?: shouldPush(codec = codec, content = codec.decode(encodedContent))

return buildFromCipherText(
headerBytes,
ciphertext,
senderHmacGenerated,
calculatedShouldPush,
shouldPush(codec = codec, content = codec.decode(encodedContent)),
)
}
}
Expand Down

0 comments on commit c2be648

Please sign in to comment.