Skip to content

Commit

Permalink
Merge pull request #99 from Unshut-Labs/ar/fix-sends
Browse files Browse the repository at this point in the history
fix: Sending messages
  • Loading branch information
alexrisch authored Jun 19, 2024
2 parents fa56ccc + 6b8359c commit 9a02600
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions utils/xmtpRN/send.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 9a02600

Please sign in to comment.