Skip to content

Commit

Permalink
cleanup: A more descriptive error for group invite accept function
Browse files Browse the repository at this point in the history
  • Loading branch information
JFreegman committed Mar 11, 2024
1 parent 3e05824 commit 6c87014
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion toxcore/tox.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Check warning on line 4272 in toxcore/tox.c

View check run for this annotation

Codecov / codecov/patch

toxcore/tox.c#L4272

Added line #L4272 was not covered by tests
return UINT32_MAX;
}

Expand Down
4 changes: 2 additions & 2 deletions toxcore/tox.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions toxcore/tox_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Check warning on line 1455 in toxcore/tox_api.c

View check run for this annotation

Codecov / codecov/patch

toxcore/tox_api.c#L1454-L1455

Added lines #L1454 - L1455 were not covered by tests

case TOX_ERR_GROUP_INVITE_ACCEPT_FAIL_SEND:
return "TOX_ERR_GROUP_INVITE_ACCEPT_FAIL_SEND";
Expand Down

0 comments on commit 6c87014

Please sign in to comment.