feat(ui-flow): staged attachment meta and reorder IPC
Handle update-staged-attachment-meta, reorder-staged-attachments, and attachmentUiById on send-message. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -995,12 +995,26 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if (t === 'update-staged-attachment-meta') {
|
||||||
|
await platform.updateStagedAttachmentMeta(msg.attachmentId, {
|
||||||
|
caption: msg.caption,
|
||||||
|
spoiler: !!msg.spoiler
|
||||||
|
})
|
||||||
|
pushState()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (t === 'reorder-staged-attachments') {
|
||||||
|
await platform.reorderStagedAttachments(msg.orderedIds || [])
|
||||||
|
pushState()
|
||||||
|
return true
|
||||||
|
}
|
||||||
if (t === 'send-message') {
|
if (t === 'send-message') {
|
||||||
const trimmed = String(msg.content || '').trim()
|
const trimmed = String(msg.content || '').trim()
|
||||||
const slashMatch = trimmed.match(/^\/([a-z0-9_-]+)/i)
|
const slashMatch = trimmed.match(/^\/([a-z0-9_-]+)/i)
|
||||||
await platform.sendMessage(msg.content, {
|
await platform.sendMessage(msg.content, {
|
||||||
replyToId: msg.replyToId,
|
replyToId: msg.replyToId,
|
||||||
attachmentIds: msg.attachmentIds,
|
attachmentIds: msg.attachmentIds,
|
||||||
|
attachmentUiById: msg.attachmentUiById,
|
||||||
stickerNames: msg.stickerNames
|
stickerNames: msg.stickerNames
|
||||||
})
|
})
|
||||||
if (platform.activeChannelId && platform.mode === 'guild') {
|
if (platform.activeChannelId && platform.mode === 'guild') {
|
||||||
|
|||||||
Reference in New Issue
Block a user