conf join

This commit is contained in:
Green Sky 2023-04-08 23:24:41 +02:00
parent de8adbd2b7
commit bb19e742b5
No known key found for this signature in database
3 changed files with 36 additions and 0 deletions

View File

@ -113,6 +113,16 @@ std::tuple<std::optional<uint32_t>, Tox_Err_Friend_Send_Message> ToxDefaultImpl:
}
}
std::tuple<std::optional<uint32_t>, Tox_Err_Conference_Join> ToxDefaultImpl::toxConferenceJoin(uint32_t friend_number, const std::vector<uint8_t>& cookie) {
Tox_Err_Conference_Join err = TOX_ERR_CONFERENCE_JOIN_OK;
auto res = tox_conference_join(_tox, friend_number, cookie.data(), cookie.size(), &err);
if (err == TOX_ERR_CONFERENCE_JOIN_OK) {
return {res, err};
} else {
return {std::nullopt, err};
}
}
Tox_Err_Conference_Send_Message ToxDefaultImpl::toxConferenceSendMessage(uint32_t conference_number, Tox_Message_Type type, std::string_view message) {
Tox_Err_Conference_Send_Message err = TOX_ERR_CONFERENCE_SEND_MESSAGE_OK;
tox_conference_send_message(_tox, conference_number, type, reinterpret_cast<const uint8_t*>(message.data()), message.size(), &err);

View File

@ -36,6 +36,7 @@ struct ToxDefaultImpl : public ToxI {
// files
// conferece
std::tuple<std::optional<uint32_t>, Tox_Err_Conference_Join> toxConferenceJoin(uint32_t friend_number, const std::vector<uint8_t>& cookie) override;
Tox_Err_Conference_Send_Message toxConferenceSendMessage(uint32_t conference_number, Tox_Message_Type type, std::string_view message) override;
Tox_Err_Friend_Custom_Packet toxFriendSendLossyPacket(uint32_t friend_number, const std::vector<uint8_t>& data) override;

View File

@ -50,7 +50,32 @@ struct ToxI_raw {
// files
// conferece
//bool tox_conference_delete(Tox *tox, uint32_t conference_number, Tox_Err_Conference_Delete *error);
//uint32_t tox_conference_peer_count(const Tox *tox, uint32_t conference_number, Tox_Err_Conference_Peer_Query *error);
//size_t tox_conference_peer_get_name_size(const Tox *tox, uint32_t conference_number, uint32_t peer_number,
//bool tox_conference_peer_get_name(const Tox *tox, uint32_t conference_number, uint32_t peer_number, uint8_t *name,
//bool tox_conference_peer_get_public_key(const Tox *tox, uint32_t conference_number, uint32_t peer_number,
//bool tox_conference_peer_number_is_ours(const Tox *tox, uint32_t conference_number, uint32_t peer_number,
//uint32_t tox_conference_offline_peer_count(const Tox *tox, uint32_t conference_number,
//size_t tox_conference_offline_peer_get_name_size(const Tox *tox, uint32_t conference_number,
//bool tox_conference_offline_peer_get_name(const Tox *tox, uint32_t conference_number, uint32_t offline_peer_number,
//bool tox_conference_offline_peer_get_public_key(const Tox *tox, uint32_t conference_number,
//uint64_t tox_conference_offline_peer_get_last_active(const Tox *tox, uint32_t conference_number,
//bool tox_conference_set_max_offline(Tox *tox, uint32_t conference_number, uint32_t max_offline_peers, Tox_Err_Conference_Set_Max_Offline *error);
//bool tox_conference_invite(Tox *tox, uint32_t friend_number, uint32_t conference_number, Tox_Err_Conference_Invite *error);
virtual std::tuple<std::optional<uint32_t>, Tox_Err_Conference_Join> toxConferenceJoin(uint32_t friend_number, const std::vector<uint8_t>& cookie) = 0;
virtual Tox_Err_Conference_Send_Message toxConferenceSendMessage(uint32_t conference_number, Tox_Message_Type type, std::string_view message) = 0;
//size_t tox_conference_get_title_size(const Tox *tox, uint32_t conference_number, Tox_Err_Conference_Title *error);
//bool tox_conference_get_title(const Tox *tox, uint32_t conference_number, uint8_t *title, Tox_Err_Conference_Title *error);
//bool tox_conference_set_title(Tox *tox, uint32_t conference_number, const uint8_t *title, size_t length, Tox_Err_Conference_Title *error);
//size_t tox_conference_get_chatlist_size(const Tox *tox);
//void tox_conference_get_chatlist(const Tox *tox, uint32_t *chatlist);
//Tox_Conference_Type tox_conference_get_type(const Tox *tox, uint32_t conference_number, Tox_Err_Conference_Get_Type *error);
//bool tox_conference_get_id(const Tox *tox, uint32_t conference_number, uint8_t *id);
//uint32_t tox_conference_by_id(const Tox *tox, const uint8_t *id, Tox_Err_Conference_By_Id *error);
//bool tox_conference_get_uid(const Tox *tox, uint32_t conference_number, uint8_t *uid);
//uint32_t tox_conference_by_uid(const Tox *tox, const uint8_t *uid, Tox_Err_Conference_By_Uid *error);
virtual Tox_Err_Friend_Custom_Packet toxFriendSendLossyPacket(uint32_t friend_number, const std::vector<uint8_t>& data) = 0;
virtual Tox_Err_Friend_Custom_Packet toxFriendSendLosslessPacket(uint32_t friend_number, const std::vector<uint8_t>& data) = 0;