chatgui: preserve active channel selection on reload, members sync, profile settings, member list model
This commit is contained in:
1 parent
ce6de7307a
commit
618cfe9bc5
28 files changed
+1895
-91
No files matched your search
@@ -347,6 +347,10 @@ void topo_groups_set_sqlite_db(struct TOPO_GROUPS* g, sqlite3* db) {
|
||||
|
||||
void topo_group_set_nat_check_local(struct TOPO_GROUP* group, int allow) { if (!group) return; group->allow_nat_check_local = allow ? 1 : 0; }
|
||||
|
||||
void topo_groups_set_node_updated_cb(struct TOPO_GROUPS* groups, topo_node_updated_fn fn) {
|
||||
if (groups) groups->node_updated_cb = fn;
|
||||
}
|
||||
|
||||
void topo_group_new_conn(struct TOPO_GROUP* group, struct ETCP_CONN* conn) {
|
||||
if (!group || !conn) { DEBUG_ERROR(DEBUG_CATEGORY_BGP, "invalid args"); return; }
|
||||
if (!conn->instance) { DEBUG_ERROR(DEBUG_CATEGORY_BGP, "conn->instance is NULL"); return; }
|
||||
@@ -636,6 +640,9 @@ int topo_group_process_nodeinfo(struct TOPO_GROUP* group, struct ETCP_CONN* from
|
||||
}
|
||||
if (group->instance->control_srv) control_server_notify_node_change(group->instance->control_srv, nodeinfo1);
|
||||
|
||||
if (group->instance->topo_groups->node_updated_cb)
|
||||
group->instance->topo_groups->node_updated_cb(group->instance, node_id, ni->public_key, ni->ed25519_public_key);
|
||||
|
||||
int hop_count = nodeinfo1->hop_count;
|
||||
struct ll_entry* se = group->senders_list ? group->senders_list->head : NULL;
|
||||
while (se) {
|
||||
|
||||
@@ -18,6 +18,13 @@ extern "C" {
|
||||
#include <sqlite3.h>
|
||||
#endif
|
||||
|
||||
struct UTUN_INSTANCE;
|
||||
|
||||
/** Callback when a node's info (pubkeys, addresses) is persisted in the DB */
|
||||
typedef void (*topo_node_updated_fn)(struct UTUN_INSTANCE* inst, uint64_t node_id,
|
||||
const uint8_t* x25519_pubkey,
|
||||
const uint8_t* ed25519_pubkey);
|
||||
|
||||
|
||||
// ETCP ID для пакетов топологии
|
||||
#define ETCP_ID_TOPO_ENTRY 0x01
|
||||
@@ -137,6 +144,7 @@ struct TOPO_GROUPS {
|
||||
#ifdef USE_SQLITE
|
||||
sqlite3* topo_sqlite_db;
|
||||
#endif
|
||||
topo_node_updated_fn node_updated_cb; /* optional — set by chatgui's member_sync */
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -267,6 +275,8 @@ void topo_group_send_nat_check_req(struct ETCP_CONN* conn, uint8_t socket_id);
|
||||
*/
|
||||
void topo_group_set_nat_check_local(struct TOPO_GROUP* group, int allow);
|
||||
|
||||
void topo_groups_set_node_updated_cb(struct TOPO_GROUPS* groups, topo_node_updated_fn fn);
|
||||
|
||||
/**
|
||||
* @brief Запускает NAT check для всех линков всех соединений.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user