Carry Android photo and video request IDs through PM preparation
This commit is contained in:
1 parent
4fd5ebf57a
commit
e943879c50
3 files changed
+5
-3
No files matched your search
@@ -27,7 +27,7 @@ struct attachment_send_req {
|
||||
uint64_t dm_generation; /* Поколение беседы до подготовки; 0 → захват в trampoline. Удалённое поколение не публикуется. */
|
||||
unsigned dm_paths_held; /* Внутренние holds output/source; caller оставляет 0. */
|
||||
uint8_t reply_to[32]; /* Оригинал канального ответа, зафиксированный до подготовки. */
|
||||
uint64_t request_id; /* Только канал: CHAT_EVT_MSG_SUBMITTED после публикации либо ошибки. Для DM — 0. */
|
||||
uint64_t request_id; /* CHAT_EVT_MSG_SUBMITTED после локального commit либо ошибки; 0=без подтверждения. */
|
||||
struct attachment_info info; /* kind обязателен; пустое name заменяется UUID.opus/mp4; для copy нужны готовые метаданные. */
|
||||
uint8_t id[16]; /* Внутренний UUID подготовки для attachment-событий; не UUID конечного media_index/DM. */
|
||||
char source[1024], output[1024]; /* source задаёт caller; output — внутреннее случайное назначение задачи. */
|
||||
|
||||
@@ -48,7 +48,8 @@ int photo_send(const char* channel_id, const char* src_file_path, const char* db
|
||||
snprintf(req->source, sizeof(req->source), "%s", src_file_path);
|
||||
snprintf(req->info.name, sizeof(req->info.name), "%s", name);
|
||||
if (attachment_validate(&req->info)) { u_free(req); u_free(post); return -1; }
|
||||
if (!req->is_dm) { memcpy(req->reply_to, reply_to, 32); req->request_id = request_id; }
|
||||
req->request_id = request_id;
|
||||
if (!req->is_dm) memcpy(req->reply_to, reply_to, 32);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_MEDIA, "photo_send: target=%s mime=%s dimensions=%dx%d bytes=%lld generation=%llu",
|
||||
channel_id, content_type, width, height, (long long)st.st_size, (unsigned long long)generation);
|
||||
post->callback = attachment_send_trampoline; post->arg = req;
|
||||
|
||||
@@ -21,7 +21,8 @@ int video_send(const char* channel_id, const char* src_file_path, const char* db
|
||||
if (!req || !post) { DEBUG_ERROR(DEBUG_CATEGORY_MEDIA, "video send: allocation failed"); u_free(req); u_free(post); return -1; }
|
||||
req->dm_generation = generation;
|
||||
req->inst = instance_lite_get_instance(); req->is_dm = !strncmp(channel_id, "dm:", 3);
|
||||
if (!req->is_dm) { memcpy(req->reply_to, reply_to, sizeof(req->reply_to)); req->request_id = request_id; }
|
||||
req->request_id = request_id;
|
||||
if (!req->is_dm) memcpy(req->reply_to, reply_to, sizeof(req->reply_to));
|
||||
snprintf(req->target, sizeof(req->target), "%s", channel_id + (req->is_dm ? 3 : 0));
|
||||
snprintf(req->source, sizeof(req->source), "%s", src_file_path);
|
||||
req->info.kind = ATTACHMENT_VIDEO; req->info.duration_ms = (uint32_t)duration_ms;
|
||||
|
||||
Reference in new issue
Block a user