update to tox interface progress

This commit is contained in:
Green Sky 2023-04-18 17:32:54 +02:00
parent bfc9cfa1b3
commit ba8ca977f1
No known key found for this signature in database
3 changed files with 56 additions and 3 deletions

View File

@ -221,10 +221,46 @@ Tox_Err_Friend_Delete ToxIPCClient::toxFriendDelete(uint32_t friend_number) {
CL_BODY(toxFriendDelete, friend_number)
}
std::tuple<std::optional<std::vector<uint8_t>>, Tox_Err_Friend_Get_Public_Key> ToxIPCClient::toxFriendGetPublicKey(uint32_t friend_number) {
std::tuple<std::optional<uint32_t>, Tox_Err_Friend_By_Public_Key> ToxIPCClient::toxFriendByPublicKey(const std::vector<uint8_t>& public_key) {
CL_BODY(toxFriendByPublicKey, public_key)
}
bool ToxIPCClient::toxFriendExists(uint32_t friend_number) {
CL_BODY(toxFriendExists, friend_number)
}
std::optional<std::vector<uint8_t>> ToxIPCClient::toxFriendGetPublicKey(uint32_t friend_number) {
CL_BODY(toxFriendGetPublicKey, friend_number)
}
std::optional<uint64_t> ToxIPCClient::toxFriendGetLastOnline(uint32_t friend_number) {
CL_BODY(toxFriendGetLastOnline, friend_number)
}
std::optional<std::string> ToxIPCClient::toxFriendGetName(uint32_t friend_number) {
CL_BODY(toxFriendGetName, friend_number)
}
std::optional<std::string> ToxIPCClient::toxFriendGetStatusMessage(uint32_t friend_number) {
CL_BODY(toxFriendGetStatusMessage, friend_number)
}
std::optional<Tox_User_Status> ToxIPCClient::toxFriendGetStatus(uint32_t friend_number) {
CL_BODY(toxFriendGetStatus, friend_number)
}
std::optional<Tox_Connection> ToxIPCClient::toxFriendGetConnectionStatus(uint32_t friend_number) {
CL_BODY(toxFriendGetConnectionStatus, friend_number)
}
std::optional<bool> ToxIPCClient::toxFriendGetTyping(uint32_t friend_number) {
CL_BODY(toxFriendGetTyping, friend_number)
}
Tox_Err_Set_Typing ToxIPCClient::toxSelfSetTyping(uint32_t friend_number, bool typing) {
CL_BODY(toxSelfSetTyping, friend_number, typing)
}
std::tuple<std::optional<uint32_t>, Tox_Err_Friend_Send_Message> ToxIPCClient::toxFriendSendMessage(uint32_t friend_number, Tox_Message_Type type, std::string_view message) {
CL_BODY(toxFriendSendMessage, friend_number, type, std::string{message})
}

View File

@ -45,8 +45,16 @@ class ToxIPCClient : public ToxI, public ToxEventProviderBase {
std::tuple<std::optional<uint32_t>, Tox_Err_Friend_Add> toxFriendAdd(const std::vector<uint8_t>& address, std::string_view message) override;
std::tuple<std::optional<uint32_t>, Tox_Err_Friend_Add> toxFriendAddNorequest(const std::vector<uint8_t>& public_key) override;
Tox_Err_Friend_Delete toxFriendDelete(uint32_t friend_number) override;
std::tuple<std::optional<std::vector<uint8_t>>, Tox_Err_Friend_Get_Public_Key> toxFriendGetPublicKey(uint32_t friend_number) override;
std::tuple<std::optional<uint32_t>, Tox_Err_Friend_By_Public_Key> toxFriendByPublicKey(const std::vector<uint8_t>& public_key) override;
bool toxFriendExists(uint32_t friend_number) override;
std::optional<std::vector<uint8_t>> toxFriendGetPublicKey(uint32_t friend_number) override;
std::optional<uint64_t> toxFriendGetLastOnline(uint32_t friend_number) override;
std::optional<std::string> toxFriendGetName(uint32_t friend_number) override;
std::optional<std::string> toxFriendGetStatusMessage(uint32_t friend_number) override;
std::optional<Tox_User_Status> toxFriendGetStatus(uint32_t friend_number) override;
std::optional<Tox_Connection> toxFriendGetConnectionStatus(uint32_t friend_number) override;
std::optional<bool> toxFriendGetTyping(uint32_t friend_number) override;
Tox_Err_Set_Typing toxSelfSetTyping(uint32_t friend_number, bool typing) override;
std::tuple<std::optional<uint32_t>, Tox_Err_Friend_Send_Message> toxFriendSendMessage(uint32_t friend_number, Tox_Message_Type type, std::string_view message) override;
// should this be virtual at all?

View File

@ -28,7 +28,16 @@ using ToxI_rpc = zpp::bits::rpc<
zpp::bits::bind<&ToxI::toxFriendAdd_str, "ToxI::toxFriendAdd"_sha1_int>,
zpp::bits::bind<&ToxI::toxFriendAddNorequest, "ToxI::toxFriendAddNorequest"_sha1_int>,
zpp::bits::bind<&ToxI::toxFriendDelete, "ToxI::toxFriendDelete"_sha1_int>,
zpp::bits::bind<&ToxI::toxFriendByPublicKey, "ToxI::toxFriendByPublicKey"_sha1_int>,
zpp::bits::bind<&ToxI::toxFriendExists, "ToxI::toxFriendExists"_sha1_int>,
zpp::bits::bind<&ToxI::toxFriendGetPublicKey, "ToxI::toxFriendGetPublicKey"_sha1_int>,
zpp::bits::bind<&ToxI::toxFriendGetLastOnline, "ToxI::toxFriendGetLastOnline"_sha1_int>,
zpp::bits::bind<&ToxI::toxFriendGetName, "ToxI::toxFriendGetName"_sha1_int>,
zpp::bits::bind<&ToxI::toxFriendGetStatusMessage, "ToxI::toxFriendGetStatusMessage"_sha1_int>,
zpp::bits::bind<&ToxI::toxFriendGetStatus, "ToxI::toxFriendGetStatus"_sha1_int>,
zpp::bits::bind<&ToxI::toxFriendGetConnectionStatus, "ToxI::toxFriendGetConnectionStatus"_sha1_int>,
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