( options: BuildRemoteSubmitPayloadOptions, deps: DispatchRemoteSubmitDeps, )
| 99 | } |
| 100 | |
| 101 | export async function dispatchRemoteSubmit( |
| 102 | options: BuildRemoteSubmitPayloadOptions, |
| 103 | deps: DispatchRemoteSubmitDeps, |
| 104 | ): Promise<UserMessage> { |
| 105 | const { messageContent, remoteContent, imagePasteIds } = |
| 106 | buildRemoteSubmitPayload(options) |
| 107 | const createUserMessageImpl = deps.createUserMessageImpl ?? createUserMessage |
| 108 | const userMessage = createUserMessageImpl({ |
| 109 | content: messageContent, |
| 110 | imagePasteIds, |
| 111 | }) |
| 112 | |
| 113 | deps.appendUserMessage(userMessage) |
| 114 | await deps.sendMessage(remoteContent, { |
| 115 | uuid: userMessage.uuid, |
| 116 | }) |
| 117 | return userMessage |
| 118 | } |
no test coverage detected