Skip to content

Commit c2be648

Browse files
author
kele-leanes
committed
Revert "feat: integrate `shouldPush' for React Native (#184)"
This reverts commit 887f1f4.
1 parent 561bab0 commit c2be648

File tree

4 files changed

+3
-8
lines changed

4 files changed

+3
-8
lines changed

library/src/main/java/org/xmtp/android/library/ConversationV2.kt

-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ data class ConversationV2(
250250
topic = topic,
251251
keyMaterial = keyMaterial,
252252
codec = codec,
253-
shouldPush = options?.__shouldPush
254253
)
255254

256255
val newTopic = if (options?.ephemeral == true) ephemeralTopic else topic

library/src/main/java/org/xmtp/android/library/SendOptions.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ import org.xmtp.proto.message.contents.Content
55
data class SendOptions(
66
var compression: EncodedContentCompression? = null,
77
var contentType: Content.ContentTypeId? = null,
8-
var ephemeral: Boolean = false,
9-
var __shouldPush: Boolean? = null
8+
var ephemeral: Boolean = false
109
)

library/src/main/java/org/xmtp/android/library/messages/DecryptedMessage.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ data class DecryptedMessage(
88
var encodedContent: EncodedContent,
99
var senderAddress: String,
1010
var sentAt: Date,
11-
var topic: String = "",
12-
var shouldPush: Boolean? = null,
11+
var topic: String = ""
1312
)

library/src/main/java/org/xmtp/android/library/messages/MessageV2.kt

+1-3
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ class MessageV2Builder(val senderHmac: ByteArray? = null, val shouldPush: Boolea
140140
topic: String,
141141
keyMaterial: ByteArray,
142142
codec: Codec,
143-
shouldPush: Boolean? = null
144143
): MessageV2Builder {
145144
val payload = encodedContent.toByteArray()
146145
val date = Date()
@@ -163,13 +162,12 @@ class MessageV2Builder(val senderHmac: ByteArray? = null, val shouldPush: Boolea
163162
Crypto.deriveKey(keyMaterial, ByteArray(0), infoEncoded),
164163
headerBytes
165164
)
166-
val calculatedShouldPush = shouldPush ?: shouldPush(codec = codec, content = codec.decode(encodedContent))
167165

168166
return buildFromCipherText(
169167
headerBytes,
170168
ciphertext,
171169
senderHmacGenerated,
172-
calculatedShouldPush,
170+
shouldPush(codec = codec, content = codec.decode(encodedContent)),
173171
)
174172
}
175173
}

0 commit comments

Comments
 (0)