|
|
|
|
@ -945,7 +945,8 @@ static void cs_handle_channel_info_resp(struct chat_sync* cs, uint64_t peer,
|
|
|
|
|
lk = lk->next; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
topo_node_sqlite_member_put(vdb, ch_id, peer, inviter_join_sig, inviter_join_ts, inviter_update_sig, inviter_update_ts, inv_x25519, inv_ed, inv_name, inviter_join_sig); |
|
|
|
|
int rc = topo_node_sqlite_member_put(vdb, ch_id, peer, inviter_join_sig, inviter_join_ts, inviter_update_sig, inviter_update_ts, inv_x25519, inv_ed, inv_name, inviter_join_sig); |
|
|
|
|
if (rc != 0) DEBUG_ERROR(DEBUG_CATEGORY_CONNECTIVITY, "%s: member_put(inviter) FAILED ch=%s peer=%016llx rc=%d", CS_ID, ch_id, (unsigned long long)peer, rc); |
|
|
|
|
topo_node_sqlite_node_update_verified(vdb, peer, inv_name, inv_x25519, inv_ed, inviter_join_ts); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -1047,7 +1048,8 @@ static void cs_handle_channel_join(struct chat_sync* cs, uint64_t peer,
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sqlite3* db = cs->inst->topo_groups->topo_sqlite_db; |
|
|
|
|
topo_node_sqlite_member_put(db, ch_id, node_id, join_sig, join_ts, NULL, 0, x25519, ed_pub, joiner_name, NULL); |
|
|
|
|
int rc = topo_node_sqlite_member_put(db, ch_id, node_id, join_sig, join_ts, NULL, 0, x25519, ed_pub, joiner_name, NULL); |
|
|
|
|
if (rc != 0) DEBUG_ERROR(DEBUG_CATEGORY_CONNECTIVITY, "%s: member_put(joiner) FAILED ch=%s node=0x%016llx rc=%d", CS_ID, ch_id, (unsigned long long)node_id, rc); |
|
|
|
|
topo_node_sqlite_node_update_verified(db, node_id, joiner_name, x25519, ed_pub, join_ts); |
|
|
|
|
/* save joiner node_info to local DB */ |
|
|
|
|
if (db && joiner_name[0]) { |
|
|
|
|
@ -1178,7 +1180,8 @@ static void cs_handle_welcome(struct chat_sync* cs, uint64_t peer,
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
topo_node_sqlite_member_put(db, ch_id, node_id, join_sig, join_ts, NULL, 0, x25519, ed_pub, peer_name, NULL); |
|
|
|
|
int rc = topo_node_sqlite_member_put(db, ch_id, node_id, join_sig, join_ts, NULL, 0, x25519, ed_pub, peer_name, NULL); |
|
|
|
|
if (rc != 0) DEBUG_ERROR(DEBUG_CATEGORY_CONNECTIVITY, "%s: member_put(welcome) FAILED ch=%s node=0x%016llx rc=%d", CS_ID, ch_id, (unsigned long long)node_id, rc); |
|
|
|
|
topo_node_sqlite_node_update_verified(db, node_id, peer_name, x25519, ed_pub, join_ts); |
|
|
|
|
|
|
|
|
|
for (uint8_t j = 0; j < ac; j++) { |
|
|
|
|
@ -1250,7 +1253,8 @@ static void cs_handle_peer_upsert(struct chat_sync* cs, uint64_t peer,
|
|
|
|
|
|
|
|
|
|
sqlite3* db = cs->inst->topo_groups->topo_sqlite_db; |
|
|
|
|
|
|
|
|
|
topo_node_sqlite_member_put(db, ch_id, node_id, join_sig, join_ts, NULL, 0, x25519, ed_pub, peer_name, NULL); |
|
|
|
|
int rc = topo_node_sqlite_member_put(db, ch_id, node_id, join_sig, join_ts, NULL, 0, x25519, ed_pub, peer_name, NULL); |
|
|
|
|
if (rc != 0) DEBUG_ERROR(DEBUG_CATEGORY_CONNECTIVITY, "%s: member_put(peer_upsert) FAILED ch=%s node=0x%016llx rc=%d", CS_ID, ch_id, (unsigned long long)node_id, rc); |
|
|
|
|
topo_node_sqlite_node_update_verified(db, node_id, peer_name, x25519, ed_pub, join_ts); |
|
|
|
|
if (db && peer_name[0]) { |
|
|
|
|
sqlite3_stmt* ns = NULL; |
|
|
|
|
|