Unificar endpoint de envío y agregar soporte para stickers
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 2m28s

- Consolidar send.post.ts y send-media.post.ts en un único endpoint /send
- Agregar servicio sticker-processor.ts para convertir imágenes a WebP 512x512
- Agregar toggle Imagen/Sticker en MediaPreview para enviar imágenes como stickers
- Actualizar MessageInput y página de mensajes para usar endpoint unificado
- Instalar dependencia sharp para procesamiento de imágenes
This commit is contained in:
2025-12-04 09:33:03 -06:00
parent 09d3c5398a
commit ec40cd6826
8 changed files with 458 additions and 291 deletions

View File

@@ -29,6 +29,7 @@
:caption="caption"
@remove="removeFile"
@update:caption="caption = $event"
@update:stickerModes="stickerModes = $event"
/>
<!-- Recording indicator -->
@@ -163,7 +164,7 @@ const props = withDefaults(defineProps<Props>(), {
})
const emit = defineEmits<{
send: [content: string, files: File[], caption: string, quotedId?: string]
send: [content: string, files: File[], caption: string, quotedId?: string, stickerModes?: boolean[]]
sendVoice: [audioFile: File]
cancelReply: []
typing: []
@@ -181,6 +182,7 @@ const message = ref('')
const selectedFiles = ref<File[]>([])
const caption = ref('')
const isDragging = ref(false)
const stickerModes = ref<boolean[]>([])
// Audio recorder
const {
@@ -258,13 +260,15 @@ const handleSend = () => {
message.value.trim(),
[...selectedFiles.value],
caption.value,
props.replyingTo?.messageId
props.replyingTo?.messageId,
[...stickerModes.value]
)
// Clear state
message.value = ''
selectedFiles.value = []
caption.value = ''
stickerModes.value = []
}
const startRecording = async () => {