add dht num closelist (with cap) to tox status command

This commit is contained in:
Green Sky 2023-12-15 11:43:46 +01:00
parent de3f845918
commit d00b3c6f8d
No known key found for this signature in database

View File

@ -38,6 +38,12 @@ void registerToxCommands(
reply += "tcp-relayed"; reply += "tcp-relayed";
} }
reply += "\ndht-closenum:";
reply += std::to_string(tp.toxDHTGetNumCloselist());
reply += "\ndht-closenum-announce-capable:";
reply += std::to_string(tp.toxDHTGetNumCloselistAnnounceCapable());
if (cr.all_of<Contact::Components::ToxFriendEphemeral>(contact_from)) { if (cr.all_of<Contact::Components::ToxFriendEphemeral>(contact_from)) {
const auto con_opt = t.toxFriendGetConnectionStatus(cr.get<Contact::Components::ToxFriendEphemeral>(contact_from).friend_number); const auto con_opt = t.toxFriendGetConnectionStatus(cr.get<Contact::Components::ToxFriendEphemeral>(contact_from).friend_number);
if (!con_opt.has_value() || con_opt.value() == Tox_Connection::TOX_CONNECTION_NONE) { if (!con_opt.has_value() || con_opt.value() == Tox_Connection::TOX_CONNECTION_NONE) {