Dispatch correlated edit submissions through shared composer request
This commit is contained in:
1 parent
407e3ada96
commit
c1754c2e17
2 files changed
+6
-1
No files matched your search
@@ -74,6 +74,7 @@ struct chat_msg_submit {
|
||||
uint32_t data_len; /* размер data в байтах */
|
||||
uint64_t timestamp; /* успешная отправка возвращает назначенное время */
|
||||
uint8_t message_id[32]; /* успешная обычная отправка возвращает общий ID */
|
||||
uint64_t expected_ver; /* >0: trampoline редактирует message_id вместо новой отправки. */
|
||||
uint8_t reply_to[32]; /* общий ID оригинала в этом канале; нули = не ответ */
|
||||
uint64_t request_id; /* ненулевой ID: trampoline/media отправляет CHAT_EVT_MSG_SUBMITTED */
|
||||
};
|
||||
|
||||
+5
-1
@@ -184,7 +184,11 @@ done:
|
||||
void chat_core_submit_trampoline(void* arg) {
|
||||
struct chat_msg_submit* req = (struct chat_msg_submit*)arg;
|
||||
if (!req) return;
|
||||
if (req->media_src[0] != '\0')
|
||||
if (req->expected_ver) {
|
||||
int result = chat_core_edit_message(req->inst, req->channel_id, req->message_id,
|
||||
req->expected_ver, (const char*)req->data, req->data_len);
|
||||
chat_event_submitted(req->inst, req->request_id, result == 0);
|
||||
} else if (req->media_src[0] != '\0')
|
||||
chat_core_submit_media_message(req->inst, req);
|
||||
else {
|
||||
int result = chat_core_submit_message(req->inst, req);
|
||||
|
||||
Reference in new issue
Block a user