|
|
|
|
@ -1081,7 +1081,7 @@ static void cs_handle_channel_info_resp(struct chat_sync* cs, uint64_t peer,
|
|
|
|
|
CS_ID, (unsigned long long)peer, (unsigned long long)inviter_update_ts); |
|
|
|
|
} |
|
|
|
|
sqlite3* vdb = cs->inst->topo_sqlite_db; |
|
|
|
|
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_userinfo, inviter_join_sig, NULL, NULL, 0); |
|
|
|
|
int rc = topo_node_sqlite_member_block_put(vdb, ch_id, peer, inviter_join_sig, inviter_join_ts, inviter_update_sig, inviter_update_ts, inv_x25519, inv_ed, inv_userinfo, inviter_join_sig); |
|
|
|
|
if (rc != 0) DEBUG_ERROR(DEBUG_CATEGORY_MEMBER_SYNC, "%s: member_put(inviter) FAILED ch=%s peer=%016llx rc=%d", CS_ID, ch_id, (unsigned long long)peer, rc); |
|
|
|
|
char inv_name[128]; json_flat_get(inv_userinfo, "name", inv_name, sizeof(inv_name)); |
|
|
|
|
topo_node_sqlite_node_update_verified(vdb, peer, inv_name, inv_x25519, inv_ed, inviter_join_ts, ntp_time_get_seconds(cs->inst)); |
|
|
|
|
@ -1153,7 +1153,7 @@ static void cs_handle_channel_join(struct chat_sync* cs, uint64_t peer,
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sqlite3* db = cs->inst->topo_sqlite_db; |
|
|
|
|
int rc = topo_node_sqlite_member_put(db, ch_id, node_id, join_sig, join_ts, NULL, 0, x25519, ed_pub, joiner_userinfo, NULL, NULL, NULL, 0); |
|
|
|
|
int rc = topo_node_sqlite_member_block_put(db, ch_id, node_id, join_sig, join_ts, NULL, 0, x25519, ed_pub, joiner_userinfo, NULL); |
|
|
|
|
if (rc != 0) DEBUG_ERROR(DEBUG_CATEGORY_MEMBER_SYNC, "%s: member_put(joiner) FAILED ch=%s node=0x%016llx rc=%d", CS_ID, ch_id, (unsigned long long)node_id, rc); |
|
|
|
|
{ char j_name[128]; json_flat_get(joiner_userinfo, "name", j_name, sizeof(j_name)); |
|
|
|
|
topo_node_sqlite_node_update_verified(db, node_id, j_name, x25519, ed_pub, join_ts, ntp_time_get_seconds(cs->inst)); } |
|
|
|
|
@ -1276,7 +1276,7 @@ static void cs_handle_welcome(struct chat_sync* cs, uint64_t peer,
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int rc = topo_node_sqlite_member_put(db, ch_id, node_id, join_sig, join_ts, NULL, 0, x25519, ed_pub, peer_userinfo, NULL, NULL, NULL, 0); |
|
|
|
|
int rc = topo_node_sqlite_member_block_put(db, ch_id, node_id, join_sig, join_ts, NULL, 0, x25519, ed_pub, peer_userinfo, NULL); |
|
|
|
|
if (rc != 0) DEBUG_ERROR(DEBUG_CATEGORY_MEMBER_SYNC, "%s: member_put(welcome) FAILED ch=%s node=0x%016llx rc=%d", CS_ID, ch_id, (unsigned long long)node_id, rc); |
|
|
|
|
{ char pn[256]; json_flat_get(peer_userinfo, "name", pn, sizeof(pn)); |
|
|
|
|
topo_node_sqlite_node_update_verified(db, node_id, pn, x25519, ed_pub, join_ts, ntp_time_get_seconds(cs->inst)); } |
|
|
|
|
@ -1292,7 +1292,7 @@ static void cs_handle_welcome(struct chat_sync* cs, uint64_t peer,
|
|
|
|
|
const uint8_t* my_x25 = cs->inst->my_keys.public_key; |
|
|
|
|
const uint8_t* my_ed = cs->inst->my_ed25519_pubkey; |
|
|
|
|
const char* my_name = cs->inst->name[0] ? cs->inst->name : ""; |
|
|
|
|
int src = topo_node_sqlite_member_put(db, ch_id, myid, NULL, 0, NULL, 0, my_x25, my_ed, my_name, NULL, NULL, NULL, 0); |
|
|
|
|
int src = topo_node_sqlite_member_block_put(db, ch_id, myid, NULL, 0, NULL, 0, my_x25, my_ed, my_name, NULL); |
|
|
|
|
if (src != 0) |
|
|
|
|
DEBUG_ERROR(DEBUG_CATEGORY_MEMBER_SYNC, "%s: member_put(self) FAILED in WELCOME ch=%s rc=%d", CS_ID, ch_id, src); |
|
|
|
|
else |
|
|
|
|
@ -1372,7 +1372,7 @@ static void cs_handle_peer_upsert(struct chat_sync* cs, uint64_t peer,
|
|
|
|
|
|
|
|
|
|
sqlite3* db = cs->inst->topo_sqlite_db; |
|
|
|
|
|
|
|
|
|
int rc = topo_node_sqlite_member_put(db, ch_id, node_id, join_sig, join_ts, NULL, 0, x25519, ed_pub, peer_userinfo, NULL, NULL, NULL, 0); |
|
|
|
|
int rc = topo_node_sqlite_member_block_put(db, ch_id, node_id, join_sig, join_ts, NULL, 0, x25519, ed_pub, peer_userinfo, NULL); |
|
|
|
|
if (rc != 0) DEBUG_ERROR(DEBUG_CATEGORY_MEMBER_SYNC, "%s: member_put(peer_upsert) FAILED ch=%s node=0x%016llx rc=%d", CS_ID, ch_id, (unsigned long long)node_id, rc); |
|
|
|
|
{ char pn2[128]; json_flat_get(peer_userinfo, "name", pn2, sizeof(pn2)); |
|
|
|
|
topo_node_sqlite_node_update_verified(db, node_id, pn2, x25519, ed_pub, join_ts, ntp_time_get_seconds(cs->inst)); } |
|
|
|
|
|