toxcore update + private interface update

This commit is contained in:
Green Sky 2024-03-11 11:46:18 +01:00
parent e801626232
commit 3cf3097094
No known key found for this signature in database
3 changed files with 18 additions and 2 deletions

@ -1 +1 @@
Subproject commit 4bd7235a739dec020365d216509474f641029113
Subproject commit ce81ef7cf7cea2fe2091912c9eafe787cbba6100

@ -1 +1 @@
Subproject commit 3b75a1c5d30c945d98df61513d80bc1b9c3ea8a0
Subproject commit cf3679018be3f90db0f2f1e9433a966692976421

View File

@ -16,4 +16,20 @@ struct ToxPrivateImpl : public ToxPrivateI {
uint16_t toxDHTGetNumCloselistAnnounceCapable(void) override {
return tox_dht_get_num_closelist_announce_capable(_tox);
}
std::tuple<std::optional<std::string>, Tox_Err_Group_Peer_Query> toxGroupPeerGetIPAddress(uint32_t group_number, uint32_t peer_id) override {
Tox_Err_Group_Peer_Query err = TOX_ERR_GROUP_PEER_QUERY_OK;
size_t str_size = tox_group_peer_get_ip_address_size(_tox, group_number, peer_id, &err);
if (err != TOX_ERR_GROUP_PEER_QUERY_OK) {
return {std::nullopt, err};
}
std::string ip_str(str_size, '\0');
tox_group_peer_get_ip_address(_tox, group_number, peer_id, reinterpret_cast<uint8_t*>(ip_str.data()), &err);
if (err == TOX_ERR_GROUP_PEER_QUERY_OK) {
return {ip_str, err};
} else {
return {std::nullopt, err};
}
}
};