Skip to content

Commit a562956

Browse files
authored
Return messageId for generic and text Conversation.send (#119)
At the moment only EncodedContent returns the messageId as result and other send function does not. Updated send function result to be consistent across all overloads.
1 parent 986ca27 commit a562956

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -107,22 +107,22 @@ sealed class Conversation {
107107
}
108108
}
109109

110-
fun send(prepared: PreparedMessage) {
111-
when (this) {
110+
fun send(prepared: PreparedMessage): String {
111+
return when (this) {
112112
is V1 -> conversationV1.send(prepared = prepared)
113113
is V2 -> conversationV2.send(prepared = prepared)
114114
}
115115
}
116116

117-
fun <T> send(content: T, options: SendOptions? = null) {
118-
when (this) {
117+
fun <T> send(content: T, options: SendOptions? = null): String {
118+
return when (this) {
119119
is V1 -> conversationV1.send(content = content, options = options)
120120
is V2 -> conversationV2.send(content = content, options = options)
121121
}
122122
}
123123

124-
fun send(text: String, sendOptions: SendOptions? = null, sentAt: Date? = null) {
125-
when (this) {
124+
fun send(text: String, sendOptions: SendOptions? = null, sentAt: Date? = null): String {
125+
return when (this) {
126126
is V1 -> conversationV1.send(text = text, sendOptions, sentAt)
127127
is V2 -> conversationV2.send(text = text, sendOptions, sentAt)
128128
}

0 commit comments

Comments
 (0)