etcp: add node_changed callback chain + chatgui subscription
- etcp.h: add node_changed_cbks field to ETCP_CONN - etcp_api.h/c: add etcp_conn_node_changed() + add/remove_node_changed_cbk - etcp_connections.c: fire node_changed callbacks on pubkey mismatch (with DEBUG_WARN(GENERAL) logging source addr, peer_id, old/new pubkey) - etcp.c: cleanup node_changed_cbks on connection close - chat_conn_mgr.c: subscribe to node_changed — clear DB addresses, reset in-memory cache, close connections (deferred for current conn), post GUI_EVT_NODE_CHANGED - gui_bridge.h: GUI_EVT_NODE_CHANGED=11 - gui_bridge_impl.cpp: handle GUI_EVT_NODE_CHANGED
This commit is contained in:
1 parent
1b21ee9d73
commit
7a5df3e196
8 files changed
+94
-3
No files matched your search
@@ -130,6 +130,14 @@ void GuiBridgeReceiver::processPost(int eventType, QByteArray data) {
|
||||
case GUI_EVT_STATUS_REFRESH:
|
||||
if (g_status_refresh_cb) g_status_refresh_cb((const char*)d, dlen);
|
||||
break;
|
||||
case GUI_EVT_NODE_CHANGED:
|
||||
if (dlen >= 8) {
|
||||
uint64_t nodeId; memcpy(&nodeId, d, 8);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "gui_bridge: NODE_CHANGED node=0x%016llx — pubkey changed, connection closed", (unsigned long long)nodeId);
|
||||
} else {
|
||||
DEBUG_WARN(DEBUG_CATEGORY_DEBUG, "gui_bridge: NODE_CHANGED data too short %d", dlen);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
DEBUG_WARN(DEBUG_CATEGORY_DEBUG, "gui_bridge: unknown event type %d", eventType);
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user