more group tox interface

This commit is contained in:
Green Sky 2023-04-19 17:44:37 +02:00
parent ba8ca977f1
commit 6d2e7af087
No known key found for this signature in database
3 changed files with 63 additions and 1 deletions

View File

@ -317,6 +317,10 @@ std::optional<bool> ToxIPCClient::toxGroupIsConnected(uint32_t group_number) {
CL_BODY(toxGroupIsConnected, group_number)
}
Tox_Err_Group_Disconnect ToxIPCClient::toxGroupDisconnect(uint32_t group_number) {
CL_BODY(toxGroupDisconnect, group_number)
}
Tox_Err_Group_Reconnect ToxIPCClient::toxGroupReconnect(uint32_t group_number) {
CL_BODY(toxGroupReconnect, group_number)
}
@ -325,18 +329,54 @@ Tox_Err_Group_Leave ToxIPCClient::toxGroupLeave(uint32_t group_number, std::stri
CL_BODY(toxGroupLeave, group_number, std::string{part_message})
}
Tox_Err_Group_Self_Name_Set ToxIPCClient::toxGroupSelfSetName(uint32_t group_number, std::string_view name) {
CL_BODY(toxGroupSelfSetName, group_number, std::string{name})
}
std::optional<std::string> ToxIPCClient::toxGroupSelfGetName(uint32_t group_number) {
CL_BODY(toxGroupSelfGetName, group_number)
}
Tox_Err_Group_Self_Status_Set ToxIPCClient::toxGroupSelfSetStatus(uint32_t group_number, Tox_User_Status status) {
CL_BODY(toxGroupSelfSetStatus, group_number, status)
}
std::optional<Tox_User_Status> ToxIPCClient::toxGroupSelfGetStatus(uint32_t group_number) {
CL_BODY(toxGroupSelfGetStatus, group_number)
}
std::optional<Tox_Group_Role> ToxIPCClient::toxGroupSelfGetRole(uint32_t group_number) {
CL_BODY(toxGroupSelfGetRole, group_number)
}
std::optional<uint32_t> ToxIPCClient::toxGroupSelfGetPeerId(uint32_t group_number) {
CL_BODY(toxGroupSelfGetPeerId, group_number)
}
std::optional<std::vector<uint8_t>> ToxIPCClient::toxGroupSelfGetPublicKey(uint32_t group_number) {
CL_BODY(toxGroupSelfGetPublicKey, group_number)
}
std::tuple<std::optional<std::string>, Tox_Err_Group_Peer_Query> ToxIPCClient::toxGroupPeerGetName(uint32_t group_number, uint32_t peer_id) {
CL_BODY(toxGroupPeerGetName, group_number, peer_id)
}
std::tuple<std::optional<Tox_User_Status>, Tox_Err_Group_Peer_Query> ToxIPCClient::toxGroupPeerGetStatus(uint32_t group_number, uint32_t peer_id) {
CL_BODY(toxGroupPeerGetStatus, group_number, peer_id)
}
std::tuple<std::optional<Tox_Group_Role>, Tox_Err_Group_Peer_Query> ToxIPCClient::toxGroupPeerGetRole(uint32_t group_number, uint32_t peer_id) {
CL_BODY(toxGroupPeerGetRole, group_number, peer_id)
}
std::tuple<std::optional<Tox_Connection>, Tox_Err_Group_Peer_Query> ToxIPCClient::toxGroupPeerGetConnectionStatus(uint32_t group_number, uint32_t peer_id) {
CL_BODY(toxGroupPeerGetConnectionStatus, group_number, peer_id)
}
std::tuple<std::optional<std::vector<uint8_t>>, Tox_Err_Group_Peer_Query> ToxIPCClient::toxGroupPeerGetPublicKey(uint32_t group_number, uint32_t peer_id) {
CL_BODY(toxGroupPeerGetPublicKey, group_number, peer_id)
}
Tox_Err_Group_Topic_Set ToxIPCClient::toxGroupSetTopic(uint32_t group_number, std::string_view topic) {
CL_BODY(toxGroupSetTopic, group_number, std::string{topic})
}

View File

@ -84,13 +84,23 @@ class ToxIPCClient : public ToxI, public ToxEventProviderBase {
std::tuple<std::optional<uint32_t>, Tox_Err_Group_New> toxGroupNew(Tox_Group_Privacy_State privacy_state, std::string_view group_name, std::string_view name) override;
std::tuple<std::optional<uint32_t>, Tox_Err_Group_Join> toxGroupJoin(const std::vector<uint8_t>& chat_id, std::string_view name, std::string_view password) override;
std::optional<bool> toxGroupIsConnected(uint32_t group_number) override;
Tox_Err_Group_Disconnect toxGroupDisconnect(uint32_t group_number) override;
Tox_Err_Group_Reconnect toxGroupReconnect(uint32_t group_number) override;
Tox_Err_Group_Leave toxGroupLeave(uint32_t group_number, std::string_view part_message) override;
Tox_Err_Group_Self_Name_Set toxGroupSelfSetName(uint32_t group_number, std::string_view name) override;
std::optional<std::string> toxGroupSelfGetName(uint32_t group_number) override;
Tox_Err_Group_Self_Status_Set toxGroupSelfSetStatus(uint32_t group_number, Tox_User_Status status) override;
std::optional<Tox_User_Status> toxGroupSelfGetStatus(uint32_t group_number) override;
std::optional<Tox_Group_Role> toxGroupSelfGetRole(uint32_t group_number) override;
std::optional<uint32_t> toxGroupSelfGetPeerId(uint32_t group_number) override;
std::optional<std::vector<uint8_t>> toxGroupSelfGetPublicKey(uint32_t group_number) override;
std::tuple<std::optional<std::string>, Tox_Err_Group_Peer_Query> toxGroupPeerGetName(uint32_t group_number, uint32_t peer_id) override;
std::tuple<std::optional<Tox_User_Status>, Tox_Err_Group_Peer_Query> toxGroupPeerGetStatus(uint32_t group_number, uint32_t peer_id) override;
std::tuple<std::optional<Tox_Group_Role>, Tox_Err_Group_Peer_Query> toxGroupPeerGetRole(uint32_t group_number, uint32_t peer_id) override;
std::tuple<std::optional<Tox_Connection>, Tox_Err_Group_Peer_Query> toxGroupPeerGetConnectionStatus(uint32_t group_number, uint32_t peer_id) override;
std::tuple<std::optional<std::vector<uint8_t>>, Tox_Err_Group_Peer_Query> toxGroupPeerGetPublicKey(uint32_t group_number, uint32_t peer_id) override;
Tox_Err_Group_Topic_Set toxGroupSetTopic(uint32_t group_number, std::string_view topic) override;
std::optional<std::string> toxGroupGetTopic(uint32_t group_number) override;

View File

@ -39,8 +39,8 @@ using ToxI_rpc = zpp::bits::rpc<
zpp::bits::bind<&ToxI::toxFriendGetTyping, "ToxI::toxFriendGetTyping"_sha1_int>,
zpp::bits::bind<&ToxI::toxSelfSetTyping, "ToxI::toxSelfSetTyping"_sha1_int>,
zpp::bits::bind<&ToxI::toxFriendSendMessage_str, "ToxI::toxFriendSendMessage"_sha1_int>,
zpp::bits::bind<&ToxI::toxHash, "ToxI::toxHash"_sha1_int>, // TODO: remove lol
zpp::bits::bind<&ToxI::toxHash, "ToxI::toxHash"_sha1_int>, // TODO: remove lol
zpp::bits::bind<&ToxI::toxFileControl, "ToxI::toxFileControl"_sha1_int>,
zpp::bits::bind<&ToxI::toxFileSeek, "ToxI::toxFileSeek"_sha1_int>,
zpp::bits::bind<&ToxI::toxFileGetFileID, "ToxI::toxFileGetFileID"_sha1_int>,
@ -49,16 +49,28 @@ using ToxI_rpc = zpp::bits::rpc<
zpp::bits::bind<&ToxI::toxConferenceJoin, "ToxI::toxConferenceJoin"_sha1_int>,
zpp::bits::bind<&ToxI::toxConferenceSendMessage_str, "ToxI::toxConferenceSendMessage"_sha1_int>,
zpp::bits::bind<&ToxI::toxFriendSendLossyPacket, "ToxI::toxFriendSendLossyPacket"_sha1_int>,
zpp::bits::bind<&ToxI::toxFriendSendLosslessPacket, "ToxI::toxFriendSendLosslessPacket"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupNew_str, "ToxI::toxGroupNew"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupJoin_str, "ToxI::toxGroupJoin"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupIsConnected, "ToxI::toxGroupIsConnected"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupDisconnect, "ToxI::toxGroupDisconnect"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupReconnect, "ToxI::toxGroupReconnect"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupLeave_str, "ToxI::toxGroupLeave"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupSelfSetName_str, "ToxI::toxGroupSelfSetName"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupSelfGetName, "ToxI::toxGroupSelfGetName"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupSelfSetStatus, "ToxI::toxGroupSelfSetStatus"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupSelfGetStatus, "ToxI::toxGroupSelfGetStatus"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupSelfGetRole, "ToxI::toxGroupSelfGetRole"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupSelfGetPeerId, "ToxI::toxGroupSelfGetPeerId"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupSelfGetPublicKey, "ToxI::toxGroupSelfGetPublicKey"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupPeerGetName, "ToxI::toxGroupPeerGetName"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupPeerGetStatus, "ToxI::toxGroupPeerGetStatus"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupPeerGetRole, "ToxI::toxGroupPeerGetRole"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupPeerGetConnectionStatus, "ToxI::toxGroupPeerGetConnectionStatus"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupPeerGetPublicKey, "ToxI::toxGroupPeerGetPublicKey"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupSetTopic_str, "ToxI::toxGroupSetTopic"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupGetTopic, "ToxI::toxGroupGetTopic"_sha1_int>,
zpp::bits::bind<&ToxI::toxGroupGetName, "ToxI::toxGroupGetName"_sha1_int>,