Browse Source

android: pass reply context through video preparation

master
evgeny 3 days ago
parent
commit
5f79d00f7a
  1. 3
      tools/chatgui-android/libutun_lite/video_sender.c
  2. 3
      tools/chatgui-android/libutun_lite/video_sender.h

3
tools/chatgui-android/libutun_lite/video_sender.c

@ -9,7 +9,7 @@
#include "instance_lite.h"
int video_send(const char* channel_id, const char* src_file_path, const char* db_path,
int duration_ms, int width, int height) {
int duration_ms, int width, int height, const uint8_t reply_to[32], uint64_t request_id) {
(void)db_path;
struct UASYNC* ua = instance_lite_get_uasync();
if (!channel_id || !src_file_path || !uasync_is_running(ua) || duration_ms <= 0 || duration_ms > 86400000 ||
@ -20,6 +20,7 @@ int video_send(const char* channel_id, const char* src_file_path, const char* db
struct posted_task* post = u_calloc(1, sizeof(*post));
if (!req || !post) { DEBUG_ERROR(DEBUG_CATEGORY_MEDIA, "video send: allocation failed"); u_free(req); u_free(post); return -1; }
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; }
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;

3
tools/chatgui-android/libutun_lite/video_sender.h

@ -4,13 +4,14 @@
* задача удаляет src_file_path после подготовки. Результат публикации приходит событием ядра. */
#ifndef VIDEO_SENDER_H
#define VIDEO_SENDER_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
int video_send(const char* channel_id, const char* src_file_path, const char* db_path,
int duration_ms, int width, int height);
int duration_ms, int width, int height, const uint8_t reply_to[32], uint64_t request_id);
#ifdef __cplusplus
}

Loading…
Cancel
Save