From ed3f2d925aec417d8955b8c11eaefc626d7bd6c6 Mon Sep 17 00:00:00 2001 From: cameronvoell Date: Thu, 12 Dec 2024 10:50:22 -0800 Subject: [PATCH] send encoded content added to Conversation class --- .../main/java/org/xmtp/android/library/Conversation.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/src/main/java/org/xmtp/android/library/Conversation.kt b/library/src/main/java/org/xmtp/android/library/Conversation.kt index dc6310667..778b8a016 100644 --- a/library/src/main/java/org/xmtp/android/library/Conversation.kt +++ b/library/src/main/java/org/xmtp/android/library/Conversation.kt @@ -1,6 +1,7 @@ package org.xmtp.android.library import kotlinx.coroutines.flow.Flow +import org.xmtp.android.library.codecs.EncodedContent import org.xmtp.android.library.libxmtp.Member import org.xmtp.android.library.libxmtp.Message import java.util.Date @@ -78,6 +79,13 @@ sealed class Conversation { } } + suspend fun send(encodedContent: EncodedContent): String { + return when (this) { + is Group -> group.send(encodedContent) + is Dm -> dm.send(encodedContent) + } + } + suspend fun send(text: String): String { return when (this) { is Group -> group.send(text)