From 1b3794e9f94f5c0d495ff1d1d0e16c52b5ec3a84 Mon Sep 17 00:00:00 2001 From: evgeny Date: Thu, 1 Oct 2026 17:50:46 +0300 Subject: [PATCH] Include common attachment preparation in both core targets --- src/Makefile.am | 4 ++++ src/media_async/attachment_send.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 02b95172..805058b3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -69,6 +69,8 @@ utun_CORE_SOURCES = \ media_async/attachment.h \ media_async/voice_file.c \ media_async/voice_file.h \ + media_async/attachment_send.c \ + media_async/attachment_send.h \ video/video.c \ transport_layer/dummynet.c \ ntp_time.c \ @@ -185,6 +187,8 @@ libutun_a_SOURCES = \ media_async/attachment.h \ media_async/voice_file.c \ media_async/voice_file.h \ + media_async/attachment_send.c \ + media_async/attachment_send.h \ video/video.c \ transport_layer/dummynet.c \ ntp_time.c \ diff --git a/src/media_async/attachment_send.c b/src/media_async/attachment_send.c index df381d4d..c42c0b45 100644 --- a/src/media_async/attachment_send.c +++ b/src/media_async/attachment_send.c @@ -115,7 +115,7 @@ static void attachment_prepare_done(void* arg, int error) { void attachment_send_trampoline(void* arg) { struct attachment_send_req* req = arg; if (!req) return; - if (!req->inst || !req->inst->chat || !req->inst->media_async || !req->target[0] || + if (!req->inst || !req->inst->chat_core || !req->inst->media_async || !req->target[0] || strspn(req->target, "0123456789") != strlen(req->target)) { DEBUG_ERROR(DEBUG_CATEGORY_MEDIA, "attachment: invalid target/stopped service"); attachment_release_pcm(req); u_free(req); return;