From ad4921dbaa2d8c98d9c3b89a113da244064f4d11 Mon Sep 17 00:00:00 2001 From: jfreegman Date: Mon, 11 Mar 2024 09:19:16 -0400 Subject: [PATCH] cleanup: A more descriptive error for group invite accept function --- toxcore/tox.c | 2 +- toxcore/tox.h | 4 ++-- toxcore/tox_api.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/toxcore/tox.c b/toxcore/tox.c index ebcb53bb41..679f1d89fd 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c @@ -4269,7 +4269,7 @@ uint32_t tox_group_invite_accept(Tox *tox, uint32_t friend_number, const uint8_t } case -6: { - SET_ERROR_PARAMETER(error, TOX_ERR_GROUP_INVITE_ACCEPT_CORE); + SET_ERROR_PARAMETER(error, TOX_ERR_GROUP_INVITE_ACCEPT_FRIEND_NOT_FOUND); return UINT32_MAX; } diff --git a/toxcore/tox.h b/toxcore/tox.h index 7aca21eab5..d953bb6694 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h @@ -4888,9 +4888,9 @@ typedef enum Tox_Err_Group_Invite_Accept { TOX_ERR_GROUP_INVITE_ACCEPT_PASSWORD, /** - * There was a core error when initiating the group. + * The friend number passed did not designate a valid friend. */ - TOX_ERR_GROUP_INVITE_ACCEPT_CORE, + TOX_ERR_GROUP_INVITE_ACCEPT_FRIEND_NOT_FOUND, /** * Packet failed to send. diff --git a/toxcore/tox_api.c b/toxcore/tox_api.c index d2ac0f5953..26da9b2490 100644 --- a/toxcore/tox_api.c +++ b/toxcore/tox_api.c @@ -1451,8 +1451,8 @@ const char *tox_err_group_invite_accept_to_string(Tox_Err_Group_Invite_Accept va case TOX_ERR_GROUP_INVITE_ACCEPT_PASSWORD: return "TOX_ERR_GROUP_INVITE_ACCEPT_PASSWORD"; - case TOX_ERR_GROUP_INVITE_ACCEPT_CORE: - return "TOX_ERR_GROUP_INVITE_ACCEPT_CORE"; + case TOX_ERR_GROUP_INVITE_ACCEPT_FRIEND_NOT_FOUND: + return "TOX_ERR_GROUP_INVITE_ACCEPT_FRIEND_NOT_FOUND"; case TOX_ERR_GROUP_INVITE_ACCEPT_FAIL_SEND: return "TOX_ERR_GROUP_INVITE_ACCEPT_FAIL_SEND";