From 6b8359c01f962d6de9395211b0cd4cb0f942f50c Mon Sep 17 00:00:00 2001 From: Alex Risch Date: Tue, 18 Jun 2024 23:00:10 -0700 Subject: [PATCH] fix: Sending messages Now sends inboxId rather than address --- utils/xmtpRN/send.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/utils/xmtpRN/send.ts b/utils/xmtpRN/send.ts index 6a58146da..b7aaeb9ad 100644 --- a/utils/xmtpRN/send.ts +++ b/utils/xmtpRN/send.ts @@ -16,9 +16,14 @@ import { } from "../../data/helpers/messages"; import { getMessagesToSend } from "../../data/helpers/messages/getMessagesToSend"; import { deserializeRemoteAttachmentMessageContent } from "./attachments"; -import { ConversationWithCodecsType, GroupWithCodecsType } from "./client"; +import { + ConversationWithCodecsType, + ConverseXmtpClientType, + GroupWithCodecsType, +} from "./client"; import { isContentType } from "./contentTypes"; import { getConversationWithTopic } from "./conversations"; +import { getXmtpClient } from "./sync"; // import { syncGroupsMessages } from "./messages"; let sendingPendingMessages = false; @@ -41,7 +46,8 @@ const sendConversePreparedMessages = async ( return; } sendingMessages[id] = true; - await sendPreparedMessage(account, preparedMessage); + const client = (await getXmtpClient(account)) as ConverseXmtpClientType; + await sendPreparedMessage(client.inboxId, preparedMessage); // Here message has been sent, let's mark it as // sent locally to make sure we don't sent twice await markMessageAsSent(account, id, preparedMessage.topic);