refactor done, now feature parity with before refactor + ft begins

This commit is contained in:
2022-10-03 03:23:38 +02:00
parent 5d6a5d8c01
commit ad55a345b2
3 changed files with 37 additions and 14 deletions

View File

@@ -89,7 +89,7 @@ bool NGC_HS1::Peer::hear(uint32_t msg_id, uint32_t peer_number) {
static void _handle_HS1_REQUEST_LAST_IDS(
Tox* tox,
NGC_HS1* ngc_hs1_ctx,
NGC_EXT_CTX* ngc_ext_ctx,
uint32_t group_number,
uint32_t peer_number,
@@ -100,7 +100,7 @@ static void _handle_HS1_REQUEST_LAST_IDS(
static void _handle_HS1_RESPONSE_LAST_IDS(
Tox* tox,
NGC_HS1* ngc_hs1_ctx,
NGC_EXT_CTX* ngc_ext_ctx,
uint32_t group_number,
uint32_t peer_number,
@@ -112,11 +112,16 @@ static void _handle_HS1_RESPONSE_LAST_IDS(
bool NGC_HS1_init(NGC_EXT_CTX* ngc_ext_ctx, const struct NGC_HS1_options* options) {
ngc_ext_ctx->ngc_hs1_ctx = new NGC_HS1;
ngc_ext_ctx->ngc_hs1_ctx->options = *options;
ngc_ext_ctx->callbacks[HS1_REQUEST_LAST_IDS] = _handle_HS1_REQUEST_LAST_IDS;
ngc_ext_ctx->callbacks[HS1_RESPONSE_LAST_IDS] = _handle_HS1_RESPONSE_LAST_IDS;
return true;
}
void NGC_HS1_kill(NGC_EXT_CTX* ngc_ext_ctx) {
delete ngc_ext_ctx->ngc_hs1_ctx;
ngc_ext_ctx->ngc_hs1_ctx = nullptr;
}
static void _iterate_group(Tox *tox, NGC_HS1* ngc_hs1_ctx, uint32_t group_number, float time_delta) {
@@ -314,7 +319,7 @@ void NGC_HS1_record_message(
static void _handle_HS1_REQUEST_LAST_IDS(
Tox* tox,
NGC_HS1* ngc_hs1_ctx,
NGC_EXT_CTX* ngc_ext_ctx,
uint32_t group_number,
uint32_t peer_number,
@@ -322,6 +327,7 @@ static void _handle_HS1_REQUEST_LAST_IDS(
const uint8_t *data,
size_t length
) {
NGC_HS1* ngc_hs1_ctx = ngc_ext_ctx->ngc_hs1_ctx;
size_t curser = 0;
_PeerKey p_key;
@@ -386,7 +392,7 @@ static void _handle_HS1_REQUEST_LAST_IDS(
static void _handle_HS1_RESPONSE_LAST_IDS(
Tox* tox,
NGC_HS1* ngc_hs1_ctx,
NGC_EXT_CTX* ngc_ext_ctx,
uint32_t group_number,
uint32_t peer_number,
@@ -394,6 +400,7 @@ static void _handle_HS1_RESPONSE_LAST_IDS(
const uint8_t *data,
size_t length
) {
NGC_HS1* ngc_hs1_ctx = ngc_ext_ctx->ngc_hs1_ctx;
size_t curser = 0;
_PeerKey p_key;