more hackery, now sends requests

This commit is contained in:
2022-09-30 02:04:25 +02:00
parent ba168d5f2d
commit 52ea6b5196
2 changed files with 320 additions and 11 deletions

View File

@ -41,7 +41,7 @@ struct NGC_HS1_options {
// 4 no one (above founder)
uint8_t default_trust_level /*= 2*/;
//bool test;
bool record_others;
};
// ========== init / kill ==========
@ -52,6 +52,10 @@ void NGC_HS1_kill(NGC_HS1* ngc_hs1_ctx);
// ========== iterate ==========
void NGC_HS1_iterate(Tox *tox, NGC_HS1* ngc_hs1_ctx/*, void *user_data*/);
// ========== peer online/offline ==========
void NGC_HS1_peer_online(Tox* tox, NGC_HS1* ngc_hs1_ctx, uint32_t group_number, uint32_t peer_number, bool online);
// ========== send ==========
// shim (same interface)
@ -81,13 +85,42 @@ void NGC_HS1_record_own_message(
// ========== receive message ==========
// !!! no shim, whould require global state !!!
// shim (same interface)
//typedef void tox_group_message_cb(Tox *tox, uint32_t group_number, uint32_t peer_id, Tox_Message_Type type,
//const uint8_t *message, size_t length, uint32_t message_id, void *user_data);
//void NGC_HS1_callback_group_message(Tox *tox, NGC_HS1* ngc_hs1_ctx, tox_group_message_cb *callback);
// record others msg
void NGC_HS1_record_message(
const Tox *tox,
NGC_HS1* ngc_hs1_ctx,
uint32_t group_number,
uint32_t peer_number,
Tox_Message_Type type, const uint8_t *message, size_t length, uint32_t message_id
);
// ========== receive custom ==========
// "callback"
void NGC_HS1_handle_group_custom_packet(
Tox* tox,
NGC_HS1* ngc_hs1_ctx,
uint32_t group_number,
uint32_t peer_number,
const uint8_t *data,
size_t length
//void *user_data
);
// ========== receive request ==========
//void NGC_HS1_custom_packet(
// ========== receive answer ==========
#ifdef __cplusplus