Phase 664: voice-note fetch and forward IPC handlers.

Wire fetch-voice-note-blob and forward-voice-note through ui-flow to
platform fetchVoiceNoteBlob and forwardVoiceNote.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-06-02 19:26:17 -04:00
co-authored by Cursor
parent 6191737259
commit 04ad8a9e62
+39
View File
@@ -1138,6 +1138,45 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
pushState() pushState()
return true return true
} }
if (t === 'fetch-voice-note-blob') {
try {
const out = await platform.fetchVoiceNoteBlob(msg.noteId)
send({
type: 'voice-note-blob-fetched',
noteId: msg.noteId,
dataBase64: out?.dataBase64 || null,
bytes: out?.bytes || 0,
progress: out?.progress || null
})
} catch (err) {
send({
type: 'voice-note-blob-fetch-error',
noteId: msg.noteId,
message: err?.message || String(err)
})
}
return true
}
if (t === 'forward-voice-note') {
try {
const out = await platform.forwardVoiceNote({
messageId: msg.messageId,
targetChannelId: msg.targetChannelId
})
send({
type: 'voice-note-forwarded',
messageId: out?.message?.id || null,
targetChannelId: msg.targetChannelId
})
pushState()
} catch (err) {
send({
type: 'voice-note-forward-error',
message: err?.message || String(err)
})
}
return true
}
if (t === 'stage-attachment') { if (t === 'stage-attachment') {
const att = await platform.stageAttachment({ const att = await platform.stageAttachment({
data: fromBase64(msg.dataBase64), data: fromBase64(msg.dataBase64),