Evaluate delayed answers after their source message arrives
This commit is contained in:
1 parent
60b4870549
commit
17444b8c8a
2 files changed
+6
-2
No files matched your search
@@ -115,7 +115,8 @@ void si_register(struct UTUN_INSTANCE* inst, struct DB_SYNC_INSTANCE* si, const
|
||||
|
||||
/* ── db_sync callback (chat_msg.c) ── */
|
||||
|
||||
void on_msg_inserted(struct DB_SYNC_INSTANCE* si, uint64_t record_ts, const char* data, size_t len, uint64_t author, int initial_sync, void* arg);
|
||||
void on_msg_inserted(struct DB_SYNC_INSTANCE* si, const uint8_t message_id[32], uint64_t record_ts,
|
||||
const char* data, size_t len, uint64_t author, int initial_sync, void* arg);
|
||||
|
||||
/* ── применить настройку group_autoconnect ко всем CHAT-группам (chat_channel.c) ── */
|
||||
|
||||
|
||||
+4
-1
@@ -7,6 +7,7 @@
|
||||
#include "chat_core_priv.h"
|
||||
#include "chat_event.h"
|
||||
#include "chat_feedback.h"
|
||||
#include "chat_poll.h"
|
||||
#include "chat_setting.h"
|
||||
#include "chat_whisper.h"
|
||||
|
||||
@@ -849,11 +850,13 @@ static int md_auto_download(struct UTUN_INSTANCE* inst,
|
||||
|
||||
/* ─── db_sync callback ─── */
|
||||
|
||||
void on_msg_inserted(struct DB_SYNC_INSTANCE* si, uint64_t record_ts, const char* data, size_t len, uint64_t author, int initial_sync, void* arg) {
|
||||
void on_msg_inserted(struct DB_SYNC_INSTANCE* si, const uint8_t message_id[32], uint64_t record_ts,
|
||||
const char* data, size_t len, uint64_t author, int initial_sync, void* arg) {
|
||||
struct UTUN_INSTANCE* inst = arg;
|
||||
struct chat_core_ctx* cc = CC(inst);
|
||||
if (!cc) return;
|
||||
char ch_id[32]; snprintf(ch_id, sizeof(ch_id), "%llu", (unsigned long long)db_sync_instance_group_id(si));
|
||||
chat_feedback_check_message(inst, ch_id, message_id);
|
||||
uint8_t evt[73]; uint8_t cl = (uint8_t)strlen(ch_id); evt[0] = cl; memcpy(evt + 1, ch_id, cl);
|
||||
memcpy(evt + 1 + cl, &author, 8);
|
||||
chat_event_post(inst, CHAT_EVT_MSG_RECEIVED, evt, 1 + cl + 8);
|
||||
|
||||
Reference in new issue
Block a user