fix chatgui: db_sync_stub + chat_sync_init for invite link join

- db_sync_stub.c: complete rewrite — proper structs, all API functions
  (db_sync_instance_add, insert_signed, set_insert_cb, select)
  Fixes db_sync_instance_add returning NULL (inst->db_sync was NULL)
- libutun/CMakeLists.txt: remove src/db_sync.c, stub replaces it
- chatgui/CMakeLists.txt: add transport/db_sync_stub.c
- utun_node.cpp: remove redundant db_sync_init/destroy,
  add chat_sync_init/destroy — server now registers svc_id=48
  Fixes 'no handler for svc_id=48' on incoming CHANNEL_INFO_REQ
This commit is contained in:
Evgeny committed 2026-07-14 17:03:00 +03:00
1 parent 0f927ccb09
commit fa2a64007c
4 files changed
+142 -18

No files matched your search

+4 -4
View File
@@ -238,10 +238,10 @@ void UtunNode::runLoop() {
etcp_router_bind(m_instance, ETCP_RT_ID_CHAT, recvCallback);
/* Initialize chat_core (DB) and db_sync (message sync) */
/* Initialize chat_core (DB) and chat_sync (channel/message P2P sync) */
chat_core_init(m_instance, m_dbPath.toUtf8().constData());
db_sync_init(m_instance);
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "chat_core + db_sync initialized");
chat_sync_init(m_instance, nullptr);
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "chat_core + chat_sync initialized");
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "utun_node: entering poll loop");
while (!m_stop) {
@@ -249,7 +249,7 @@ void UtunNode::runLoop() {
}
etcp_router_bind(m_instance, ETCP_RT_ID_CHAT, nullptr);
db_sync_destroy(m_instance);
chat_sync_destroy(m_instance);
chat_core_destroy(m_instance);
utun_instance_destroy(m_instance);
m_instance = nullptr;