From 727c341899a82c911a27a5cac6d09bb23ce06b1d Mon Sep 17 00:00:00 2001 From: Green Sky Date: Wed, 6 Nov 2024 10:07:49 +0100 Subject: [PATCH] more interface work, almost done now --- solanaceae/toxcore/tox_default_impl.cpp | 139 ++++++++++++++++++++++++ solanaceae/toxcore/tox_default_impl.hpp | 31 +++--- solanaceae/toxcore/tox_interface.hpp | 39 ++++--- solanaceae/toxcore/toxcore_enums.hpp | 92 ++++++++++++++++ 4 files changed, 269 insertions(+), 32 deletions(-) diff --git a/solanaceae/toxcore/tox_default_impl.cpp b/solanaceae/toxcore/tox_default_impl.cpp index 4a7fdea..987af6c 100644 --- a/solanaceae/toxcore/tox_default_impl.cpp +++ b/solanaceae/toxcore/tox_default_impl.cpp @@ -1,5 +1,25 @@ #include "./tox_default_impl.hpp" +Tox_Err_Bootstrap ToxDefaultImpl::toxBootstrap(const std::string& host, uint16_t port, const std::vector& public_key) { + if (public_key.size() != TOX_PUBLIC_KEY_SIZE) { + return TOX_ERR_BOOTSTRAP_NULL; + } + + Tox_Err_Bootstrap err = TOX_ERR_BOOTSTRAP_OK; + tox_bootstrap(_tox, host.c_str(), port, public_key.data(), &err); + return err; +} + +Tox_Err_Bootstrap ToxDefaultImpl::toxAddTcpRelay(const std::string& host, uint16_t port, const std::vector& public_key) { + if (public_key.size() != TOX_PUBLIC_KEY_SIZE) { + return TOX_ERR_BOOTSTRAP_NULL; + } + + Tox_Err_Bootstrap err = TOX_ERR_BOOTSTRAP_OK; + tox_add_tcp_relay(_tox, host.c_str(), port, public_key.data(), &err); + return err; +} + Tox_Connection ToxDefaultImpl::toxSelfGetConnectionStatus(void) { return tox_self_get_connection_status(_tox); } @@ -30,6 +50,13 @@ std::vector ToxDefaultImpl::toxSelfGetPublicKey(void) { return self_pub; } +std::vector ToxDefaultImpl::toxSelfGetSecretKey(void) { + std::vector self_prv{}; + self_prv.resize(TOX_SECRET_KEY_SIZE); + tox_self_get_secret_key(_tox, self_prv.data()); + return self_prv; +} + Tox_Err_Set_Info ToxDefaultImpl::toxSelfSetName(std::string_view name) { Tox_Err_Set_Info err = TOX_ERR_SET_INFO_OK; tox_self_set_name(_tox, reinterpret_cast(name.data()), name.size(), &err); @@ -735,6 +762,65 @@ std::vector ToxDefaultImpl::toxGroupGetList(void) { return group_list; } +std::optional ToxDefaultImpl::toxGroupGetPrivacyState(uint32_t group_number) { + Tox_Err_Group_State_Query err = TOX_ERR_GROUP_STATE_QUERY_OK; + const auto state = tox_group_get_privacy_state(_tox, group_number, &err); + if (err == TOX_ERR_GROUP_STATE_QUERY_OK) { + return state; + } else { + return std::nullopt; + } +} + +std::optional ToxDefaultImpl::toxGroupGetVoiceState(uint32_t group_number) { + Tox_Err_Group_State_Query err = TOX_ERR_GROUP_STATE_QUERY_OK; + const auto state = tox_group_get_voice_state(_tox, group_number, &err); + if (err == TOX_ERR_GROUP_STATE_QUERY_OK) { + return state; + } else { + return std::nullopt; + } +} + +std::optional ToxDefaultImpl::toxGroupGetTopicLock(uint32_t group_number) { + Tox_Err_Group_State_Query err = TOX_ERR_GROUP_STATE_QUERY_OK; + const auto state = tox_group_get_topic_lock(_tox, group_number, &err); + if (err == TOX_ERR_GROUP_STATE_QUERY_OK) { + return state == TOX_GROUP_TOPIC_LOCK_ENABLED; + } else { + return std::nullopt; + } +} + +std::optional ToxDefaultImpl::toxGroupGetPeerLimit(uint32_t group_number) { + Tox_Err_Group_State_Query err = TOX_ERR_GROUP_STATE_QUERY_OK; + const auto state = tox_group_get_peer_limit(_tox, group_number, &err); + if (err == TOX_ERR_GROUP_STATE_QUERY_OK) { + return state; + } else { + return std::nullopt; + } +} + +std::optional ToxDefaultImpl::toxGroupGetPassword(uint32_t group_number) { + std::string password; + + Tox_Err_Group_State_Query err = TOX_ERR_GROUP_STATE_QUERY_OK; + const auto size = tox_group_get_password_size(_tox, group_number, &err); + if (err != TOX_ERR_GROUP_STATE_QUERY_OK) { + return std::nullopt; + } + + password.resize(size); + tox_group_get_password(_tox, group_number, reinterpret_cast(password.data()), &err); + + if (err == TOX_ERR_GROUP_STATE_QUERY_OK) { + return password; + } else { + return std::nullopt; + } +} + std::tuple, Tox_Err_Group_Send_Message> ToxDefaultImpl::toxGroupSendMessage(uint32_t group_number, Tox_Message_Type type, std::string_view message) { Tox_Err_Group_Send_Message err = TOX_ERR_GROUP_SEND_MESSAGE_OK; uint32_t message_id = tox_group_send_message(_tox, group_number, type, reinterpret_cast(message.data()), message.size(), &err); @@ -783,3 +869,56 @@ std::tuple, Tox_Err_Group_Invite_Accept> ToxDefaultImpl: } } +Tox_Err_Group_Set_Password ToxDefaultImpl::toxGroupSetPassword(uint32_t group_number, std::string_view password) { + Tox_Err_Group_Set_Password err = TOX_ERR_GROUP_SET_PASSWORD_OK; + tox_group_set_password(_tox, group_number, reinterpret_cast(password.data()), password.size(), &err); + return err; +} + +Tox_Err_Group_Set_Topic_Lock ToxDefaultImpl::toxGroupSetTopicLock(uint32_t group_number, bool topic_lock) { + Tox_Err_Group_Set_Topic_Lock err = TOX_ERR_GROUP_SET_TOPIC_LOCK_OK; + tox_group_set_topic_lock( + _tox, + group_number, + topic_lock ? TOX_GROUP_TOPIC_LOCK_ENABLED : TOX_GROUP_TOPIC_LOCK_DISABLED, + &err + ); + return err; +} + +Tox_Err_Group_Set_Voice_State ToxDefaultImpl::toxGroupSetVoiceState(uint32_t group_number, Tox_Group_Voice_State voice_state) { + Tox_Err_Group_Set_Voice_State err = TOX_ERR_GROUP_SET_VOICE_STATE_OK; + tox_group_set_voice_state(_tox, group_number, voice_state, &err); + return err; +} + +Tox_Err_Group_Set_Privacy_State ToxDefaultImpl::toxGroupSetPrivacyState(uint32_t group_number, Tox_Group_Privacy_State privacy_state) { + Tox_Err_Group_Set_Privacy_State err = TOX_ERR_GROUP_SET_PRIVACY_STATE_OK; + tox_group_set_privacy_state(_tox, group_number, privacy_state, &err); + return err; +} + +Tox_Err_Group_Set_Peer_Limit ToxDefaultImpl::toxGroupSetPeerLimit(uint32_t group_number, uint16_t max_peers) { + Tox_Err_Group_Set_Peer_Limit err = TOX_ERR_GROUP_SET_PEER_LIMIT_OK; + tox_group_set_peer_limit(_tox, group_number, max_peers, &err); + return err; +} + +Tox_Err_Group_Set_Ignore ToxDefaultImpl::toxGroupSetIgnore(uint32_t group_number, uint32_t peer_id, bool ignore) { + Tox_Err_Group_Set_Ignore err = TOX_ERR_GROUP_SET_IGNORE_OK; + tox_group_set_ignore(_tox, group_number, peer_id, ignore, &err); + return err; +} + +Tox_Err_Group_Set_Role ToxDefaultImpl::toxGroupSetRole(uint32_t group_number, uint32_t peer_id, Tox_Group_Role role) { + Tox_Err_Group_Set_Role err = TOX_ERR_GROUP_SET_ROLE_OK; + tox_group_set_role(_tox, group_number, peer_id, role, &err); + return err; +} + +Tox_Err_Group_Kick_Peer ToxDefaultImpl::toxGroupKickPeer(uint32_t group_number, uint32_t peer_id) { + Tox_Err_Group_Kick_Peer err = TOX_ERR_GROUP_KICK_PEER_OK; + tox_group_kick_peer(_tox, group_number, peer_id, &err); + return err; +} + diff --git a/solanaceae/toxcore/tox_default_impl.hpp b/solanaceae/toxcore/tox_default_impl.hpp index 36a601d..e9f7b78 100644 --- a/solanaceae/toxcore/tox_default_impl.hpp +++ b/solanaceae/toxcore/tox_default_impl.hpp @@ -8,6 +8,9 @@ struct ToxDefaultImpl : public ToxI { virtual ~ToxDefaultImpl(void) {} + Tox_Err_Bootstrap toxBootstrap(const std::string& host, uint16_t port, const std::vector& public_key) override; + Tox_Err_Bootstrap toxAddTcpRelay(const std::string& host, uint16_t port, const std::vector& public_key) override; + Tox_Connection toxSelfGetConnectionStatus(void) override; uint32_t toxIterationInterval(void) override; @@ -17,7 +20,7 @@ struct ToxDefaultImpl : public ToxI { uint32_t toxSelfGetNospam(void) override; std::vector toxSelfGetPublicKey(void) override; - //virtual void toxSelfGetSecretKey(const Tox *tox, uint8_t *secret_key); + std::vector toxSelfGetSecretKey(void) override; Tox_Err_Set_Info toxSelfSetName(std::string_view name) override; std::string toxSelfGetName(void) override; @@ -122,11 +125,11 @@ struct ToxDefaultImpl : public ToxI { size_t toxGroupGetNumberGroups(void) override; std::vector toxGroupGetList(void) override; - //virtual Tox_Group_Privacy_State toxGroupGetPrivacyState(uint32_t group_number, Tox_Err_Group_State_Queries *error) = 0; - //virtual Tox_Group_Voice_State toxGroupGetVoiceState(uint32_t group_number, Tox_Err_Group_State_Queries *error) = 0; - //virtual Tox_Group_Topic_Lock toxGroupGetTopicLock(uint32_t group_number, Tox_Err_Group_State_Queries *error) = 0; - //virtual uint16_t toxGroupGetPeerLimit(uint32_t group_number, Tox_Err_Group_State_Queries *error) = 0; - //virtual std::string toxGroupGetPassword(uint32_t group_number, Tox_Err_Group_State_Queries *error) = 0; + std::optional toxGroupGetPrivacyState(uint32_t group_number) override; + std::optional toxGroupGetVoiceState(uint32_t group_number) override; + std::optional toxGroupGetTopicLock(uint32_t group_number) override; + std::optional toxGroupGetPeerLimit(uint32_t group_number) override; + std::optional toxGroupGetPassword(uint32_t group_number) override; std::tuple, Tox_Err_Group_Send_Message> toxGroupSendMessage(uint32_t group_number, Tox_Message_Type type, std::string_view message) override; std::tuple, Tox_Err_Group_Send_Private_Message> toxGroupSendPrivateMessage(uint32_t group_number, uint32_t peer_id, Tox_Message_Type type, std::string_view message) override; @@ -136,14 +139,14 @@ struct ToxDefaultImpl : public ToxI { Tox_Err_Group_Invite_Friend toxGroupInviteFriend(uint32_t group_number, uint32_t friend_number) override; std::tuple, Tox_Err_Group_Invite_Accept> toxGroupInviteAccept(uint32_t friend_number, const std::vector& invite_data, std::string_view name, std::string_view password) override; - //virtual Tox_Err_Group_Founder_Set_Password toxGroupFounderSetPassword(uint32_t group_number, std::string_view password) = 0; - //virtual Tox_Err_Group_Founder_Set_Topic_Lock toxGroupFounderSetTopicLock(uint32_t group_number, Tox_Group_Topic_Lock topic_lock) = 0; - //virtual Tox_Err_Group_Founder_Set_Voice_State toxGroupFounderSetVoiceState(uint32_t group_number, Tox_Group_Voice_State voice_state) = 0; - //virtual Tox_Err_Group_Founder_Set_Privacy_State toxGroupFounderSetPrivacyState(uint32_t group_number, Tox_Group_Privacy_State privacy_state) = 0; - //virtual Tox_Err_Group_Founder_Set_Peer_Limit toxGroupFounderSetPeerLimit(uint32_t group_number, uint16_t max_peers) = 0; - //virtual Tox_Err_Group_Set_Ignore toxGroupSetIgnore(uint32_t group_number, uint32_t peer_id, bool ignore) = 0; - //virtual Tox_Err_Group_Mod_Set_Role toxGroupModSetRole(uint32_t group_number, uint32_t peer_id, Tox_Group_Role role) = 0; - //virtual Tox_Err_Group_Mod_Kick_Peer toxGroupModKickPeer(uint32_t group_number, uint32_t peer_id) = 0; + Tox_Err_Group_Set_Password toxGroupSetPassword(uint32_t group_number, std::string_view password) override; + Tox_Err_Group_Set_Topic_Lock toxGroupSetTopicLock(uint32_t group_number, bool topic_lock) override; + Tox_Err_Group_Set_Voice_State toxGroupSetVoiceState(uint32_t group_number, Tox_Group_Voice_State voice_state) override; + Tox_Err_Group_Set_Privacy_State toxGroupSetPrivacyState(uint32_t group_number, Tox_Group_Privacy_State privacy_state) override; + Tox_Err_Group_Set_Peer_Limit toxGroupSetPeerLimit(uint32_t group_number, uint16_t max_peers) override; + Tox_Err_Group_Set_Ignore toxGroupSetIgnore(uint32_t group_number, uint32_t peer_id, bool ignore) override; + Tox_Err_Group_Set_Role toxGroupSetRole(uint32_t group_number, uint32_t peer_id, Tox_Group_Role role) override; + Tox_Err_Group_Kick_Peer toxGroupKickPeer(uint32_t group_number, uint32_t peer_id) override; }; diff --git a/solanaceae/toxcore/tox_interface.hpp b/solanaceae/toxcore/tox_interface.hpp index 58797b4..67b278d 100644 --- a/solanaceae/toxcore/tox_interface.hpp +++ b/solanaceae/toxcore/tox_interface.hpp @@ -1,6 +1,5 @@ #pragma once -//#include #include "./toxcore_enums.hpp" #include @@ -8,16 +7,18 @@ #include #include #include +#include // TODO: c++20 span // TODO: use span in utils +// yea use spans, replace all vec params with ByteSpan // TODO: asyncable // defines the full interface for tox // HACK: raw struct ToxI_raw { - static constexpr const char* version {"9"}; + static constexpr const char* version {"10"}; virtual ~ToxI_raw(void) {} @@ -25,8 +26,9 @@ struct ToxI_raw { // size stuff // options? (no) // get save data? - // bootstrap - // add tcp relay + + virtual Tox_Err_Bootstrap toxBootstrap(const std::string& host, uint16_t port, const std::vector& public_key /*[TOX_PUBLIC_KEY_SIZE]*/) = 0; + virtual Tox_Err_Bootstrap toxAddTcpRelay(const std::string& host, uint16_t port, const std::vector& public_key /*[TOX_PUBLIC_KEY_SIZE]*/) = 0; virtual Tox_Connection toxSelfGetConnectionStatus(void) = 0; virtual uint32_t toxIterationInterval(void) = 0; @@ -38,7 +40,7 @@ struct ToxI_raw { virtual uint32_t toxSelfGetNospam(void) = 0; virtual std::vector toxSelfGetPublicKey(void) = 0; - //virtual void toxSelfGetSecretKey(const Tox *tox, uint8_t *secret_key); + virtual std::vector toxSelfGetSecretKey(void) = 0; virtual Tox_Err_Set_Info toxSelfSetName(std::string_view name) = 0; virtual std::string toxSelfGetName(void) = 0; @@ -153,11 +155,12 @@ struct ToxI_raw { virtual size_t toxGroupGetNumberGroups(void) = 0; virtual std::vector toxGroupGetList(void) = 0; - //virtual Tox_Group_Privacy_State toxGroupGetPrivacyState(uint32_t group_number, Tox_Err_Group_State_Queries *error) = 0; - //virtual Tox_Group_Voice_State toxGroupGetVoiceState(uint32_t group_number, Tox_Err_Group_State_Queries *error) = 0; - //virtual Tox_Group_Topic_Lock toxGroupGetTopicLock(uint32_t group_number, Tox_Err_Group_State_Queries *error) = 0; - //virtual uint16_t toxGroupGetPeerLimit(uint32_t group_number, Tox_Err_Group_State_Queries *error) = 0; - //virtual std::string toxGroupGetPassword(uint32_t group_number, Tox_Err_Group_State_Queries *error) = 0; + // only 1 error type, skip + virtual std::optional toxGroupGetPrivacyState(uint32_t group_number) = 0; + virtual std::optional toxGroupGetVoiceState(uint32_t group_number) = 0; + virtual std::optional toxGroupGetTopicLock(uint32_t group_number) = 0; + virtual std::optional toxGroupGetPeerLimit(uint32_t group_number) = 0; + virtual std::optional toxGroupGetPassword(uint32_t group_number) = 0; // returns message_id virtual std::tuple, Tox_Err_Group_Send_Message> toxGroupSendMessage(uint32_t group_number, Tox_Message_Type type, std::string_view message) = 0; @@ -168,15 +171,15 @@ struct ToxI_raw { virtual Tox_Err_Group_Invite_Friend toxGroupInviteFriend(uint32_t group_number, uint32_t friend_number) = 0; virtual std::tuple, Tox_Err_Group_Invite_Accept> toxGroupInviteAccept(uint32_t friend_number, const std::vector& invite_data, std::string_view name, std::string_view password) = 0; - //virtual Tox_Err_Group_Founder_Set_Password toxGroupFounderSetPassword(uint32_t group_number, std::string_view password) = 0; - //virtual Tox_Err_Group_Founder_Set_Topic_Lock toxGroupFounderSetTopicLock(uint32_t group_number, Tox_Group_Topic_Lock topic_lock) = 0; - //virtual Tox_Err_Group_Founder_Set_Voice_State toxGroupFounderSetVoiceState(uint32_t group_number, Tox_Group_Voice_State voice_state) = 0; - //virtual Tox_Err_Group_Founder_Set_Privacy_State toxGroupFounderSetPrivacyState(uint32_t group_number, Tox_Group_Privacy_State privacy_state) = 0; - //virtual Tox_Err_Group_Founder_Set_Peer_Limit toxGroupFounderSetPeerLimit(uint32_t group_number, uint16_t max_peers) = 0; - //virtual Tox_Err_Group_Set_Ignore toxGroupSetIgnore(uint32_t group_number, uint32_t peer_id, bool ignore) = 0; - //virtual Tox_Err_Group_Mod_Set_Role toxGroupModSetRole(uint32_t group_number, uint32_t peer_id, Tox_Group_Role role) = 0; - //virtual Tox_Err_Group_Mod_Kick_Peer toxGroupModKickPeer(uint32_t group_number, uint32_t peer_id) = 0; + virtual Tox_Err_Group_Set_Password toxGroupSetPassword(uint32_t group_number, std::string_view password) = 0; + virtual Tox_Err_Group_Set_Topic_Lock toxGroupSetTopicLock(uint32_t group_number, bool topic_lock) = 0; + virtual Tox_Err_Group_Set_Voice_State toxGroupSetVoiceState(uint32_t group_number, Tox_Group_Voice_State voice_state) = 0; + virtual Tox_Err_Group_Set_Privacy_State toxGroupSetPrivacyState(uint32_t group_number, Tox_Group_Privacy_State privacy_state) = 0; + virtual Tox_Err_Group_Set_Peer_Limit toxGroupSetPeerLimit(uint32_t group_number, uint16_t max_peers) = 0; + virtual Tox_Err_Group_Set_Ignore toxGroupSetIgnore(uint32_t group_number, uint32_t peer_id, bool ignore) = 0; + virtual Tox_Err_Group_Set_Role toxGroupSetRole(uint32_t group_number, uint32_t peer_id, Tox_Group_Role role) = 0; + virtual Tox_Err_Group_Kick_Peer toxGroupKickPeer(uint32_t group_number, uint32_t peer_id) = 0; }; // HACK: work around zppbits inability to pass string_view as parameter ( https://github.com/eyalz800/zpp_bits/issues/107 ) diff --git a/solanaceae/toxcore/toxcore_enums.hpp b/solanaceae/toxcore/toxcore_enums.hpp index 329913c..1c60417 100644 --- a/solanaceae/toxcore/toxcore_enums.hpp +++ b/solanaceae/toxcore/toxcore_enums.hpp @@ -14,6 +14,13 @@ // TODO: replace all types // TODO: replace all errors with custom +enum Tox_Err_Bootstrap { + TOX_ERR_BOOTSTRAP_OK, + TOX_ERR_BOOTSTRAP_NULL, + TOX_ERR_BOOTSTRAP_BAD_HOST, + TOX_ERR_BOOTSTRAP_BAD_PORT, +}; + enum Tox_Connection { TOX_CONNECTION_NONE, TOX_CONNECTION_TCP, @@ -225,6 +232,12 @@ enum Tox_Group_Privacy_State { TOX_GROUP_PRIVACY_STATE_PRIVATE, }; +enum Tox_Group_Voice_State { + TOX_GROUP_VOICE_STATE_ALL, + TOX_GROUP_VOICE_STATE_MODERATOR, + TOX_GROUP_VOICE_STATE_FOUNDER, +}; + enum Tox_Err_Group_Join { TOX_ERR_GROUP_JOIN_OK, TOX_ERR_GROUP_JOIN_INIT, @@ -275,6 +288,11 @@ enum Tox_Err_Group_Peer_Query { TOX_ERR_GROUP_PEER_QUERY_PEER_NOT_FOUND, }; +//enum Tox_Err_Group_State_Query { +// TOX_ERR_GROUP_STATE_QUERY_OK, +// TOX_ERR_GROUP_STATE_QUERY_GROUP_NOT_FOUND, +//}; + enum Tox_Err_Group_Topic_Set { TOX_ERR_GROUP_TOPIC_SET_OK, TOX_ERR_GROUP_TOPIC_SET_GROUP_NOT_FOUND, @@ -354,5 +372,79 @@ enum Tox_Err_Group_Invite_Accept { TOX_ERR_GROUP_INVITE_ACCEPT_FAIL_SEND, }; +enum Tox_Err_Group_Set_Password { + TOX_ERR_GROUP_SET_PASSWORD_OK, + TOX_ERR_GROUP_SET_PASSWORD_GROUP_NOT_FOUND, + TOX_ERR_GROUP_SET_PASSWORD_PERMISSIONS, + TOX_ERR_GROUP_SET_PASSWORD_TOO_LONG, + TOX_ERR_GROUP_SET_PASSWORD_FAIL_SEND, + TOX_ERR_GROUP_SET_PASSWORD_MALLOC, + TOX_ERR_GROUP_SET_PASSWORD_DISCONNECTED, +}; + +enum Tox_Err_Group_Set_Topic_Lock { + TOX_ERR_GROUP_SET_TOPIC_LOCK_OK, + TOX_ERR_GROUP_SET_TOPIC_LOCK_GROUP_NOT_FOUND, + TOX_ERR_GROUP_SET_TOPIC_LOCK_INVALID, + TOX_ERR_GROUP_SET_TOPIC_LOCK_PERMISSIONS, + TOX_ERR_GROUP_SET_TOPIC_LOCK_FAIL_SET, + TOX_ERR_GROUP_SET_TOPIC_LOCK_FAIL_SEND, + TOX_ERR_GROUP_SET_TOPIC_LOCK_DISCONNECTED, +}; + +enum Tox_Err_Group_Set_Voice_State { + TOX_ERR_GROUP_SET_VOICE_STATE_OK, + TOX_ERR_GROUP_SET_VOICE_STATE_GROUP_NOT_FOUND, + TOX_ERR_GROUP_SET_VOICE_STATE_PERMISSIONS, + TOX_ERR_GROUP_SET_VOICE_STATE_FAIL_SET, + TOX_ERR_GROUP_SET_VOICE_STATE_FAIL_SEND, + TOX_ERR_GROUP_SET_VOICE_STATE_DISCONNECTED, +}; + +enum Tox_Err_Group_Set_Privacy_State { + TOX_ERR_GROUP_SET_PRIVACY_STATE_OK, + TOX_ERR_GROUP_SET_PRIVACY_STATE_GROUP_NOT_FOUND, + TOX_ERR_GROUP_SET_PRIVACY_STATE_PERMISSIONS, + TOX_ERR_GROUP_SET_PRIVACY_STATE_FAIL_SET, + TOX_ERR_GROUP_SET_PRIVACY_STATE_FAIL_SEND, + TOX_ERR_GROUP_SET_PRIVACY_STATE_DISCONNECTED, +}; + +enum Tox_Err_Group_Set_Peer_Limit { + TOX_ERR_GROUP_SET_PEER_LIMIT_OK, + TOX_ERR_GROUP_SET_PEER_LIMIT_GROUP_NOT_FOUND, + TOX_ERR_GROUP_SET_PEER_LIMIT_PERMISSIONS, + TOX_ERR_GROUP_SET_PEER_LIMIT_FAIL_SET, + TOX_ERR_GROUP_SET_PEER_LIMIT_FAIL_SEND, + TOX_ERR_GROUP_SET_PEER_LIMIT_DISCONNECTED, +}; + +enum Tox_Err_Group_Set_Ignore { + TOX_ERR_GROUP_SET_IGNORE_OK, + TOX_ERR_GROUP_SET_IGNORE_GROUP_NOT_FOUND, + TOX_ERR_GROUP_SET_IGNORE_PEER_NOT_FOUND, + TOX_ERR_GROUP_SET_IGNORE_SELF, +}; + +enum Tox_Err_Group_Set_Role { + TOX_ERR_GROUP_SET_ROLE_OK, + TOX_ERR_GROUP_SET_ROLE_GROUP_NOT_FOUND, + TOX_ERR_GROUP_SET_ROLE_PEER_NOT_FOUND, + TOX_ERR_GROUP_SET_ROLE_PERMISSIONS, + TOX_ERR_GROUP_SET_ROLE_ASSIGNMENT, + TOX_ERR_GROUP_SET_ROLE_FAIL_ACTION, + TOX_ERR_GROUP_SET_ROLE_SELF, +}; + +enum Tox_Err_Group_Kick_Peer { + TOX_ERR_GROUP_KICK_PEER_OK, + TOX_ERR_GROUP_KICK_PEER_GROUP_NOT_FOUND, + TOX_ERR_GROUP_KICK_PEER_PEER_NOT_FOUND, + TOX_ERR_GROUP_KICK_PEER_PERMISSIONS, + TOX_ERR_GROUP_KICK_PEER_FAIL_ACTION, + TOX_ERR_GROUP_KICK_PEER_FAIL_SEND, + TOX_ERR_GROUP_KICK_PEER_SELF, +}; + #endif // C_TOXCORE_TOXCORE_TOX_H