Skip to content

Commit

Permalink
docs: Update the docs for group join functions
Browse files Browse the repository at this point in the history
The docs now reflect the changes made in commit fc06506. The getfriend_id
check was also removed as it no longer serves a purpose. It previously
would indicate that the group already existed.
  • Loading branch information
JFreegman committed Dec 20, 2024
1 parent fc06506 commit 8139dad
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
4 changes: 0 additions & 4 deletions toxcore/group_chats.c
Original file line number Diff line number Diff line change
Expand Up @@ -7798,10 +7798,6 @@ int gc_group_join(GC_Session *c, const uint8_t *chat_id, const uint8_t *nick, si
return ret != 0 ? -6 : ret;
}

if (getfriend_id(c->messenger, chat_id) != -1) {
return -2;
}

const int group_number = create_new_group(c, nick, nick_length, false, GI_PUBLIC);

if (group_number == -1) {
Expand Down
2 changes: 1 addition & 1 deletion toxcore/group_chats.h
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ int gc_group_add(GC_Session *c, Group_Privacy_State privacy_state, const uint8_t
*
* Return group_number on success.
* Return -1 if the group object fails to initialize.
* Return -2 if chat_id is NULL or a group with chat_id already exists in the chats array.
* Return -2 if chat_id is NULL.
* Return -3 if nick is too long.
* Return -4 if nick is empty or nick length is zero.
* Return -5 if there is an error setting the group password.
Expand Down
4 changes: 1 addition & 3 deletions toxcore/tox.h
Original file line number Diff line number Diff line change
Expand Up @@ -3685,9 +3685,7 @@ typedef enum Tox_Err_Group_Join {
TOX_ERR_GROUP_JOIN_INIT,

/**
* The chat_id pointer is set to NULL or a group with chat_id already
* exists. This usually happens if the client attempts to create multiple
* sessions for the same group.
* The chat_id pointer is set to NULL.
*/
TOX_ERR_GROUP_JOIN_BAD_CHAT_ID,

Expand Down

0 comments on commit 8139dad

Please sign in to comment.