Skip to content

Commit 7bfd0dc

Browse files
committed
docs: Update the docs for group join functions
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.
1 parent 380dde9 commit 7bfd0dc

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

toxcore/group_chats.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7797,10 +7797,6 @@ int gc_group_join(GC_Session *c, const uint8_t *chat_id, const uint8_t *nick, si
77977797
return ret != 0 ? -6 : ret;
77987798
}
77997799

7800-
if (getfriend_id(c->messenger, chat_id) != -1) {
7801-
return -2;
7802-
}
7803-
78047800
const int group_number = create_new_group(c->messenger->mem, c, nick, nick_length, false, GI_PUBLIC);
78057801

78067802
if (group_number == -1) {

toxcore/group_chats.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ int gc_group_add(GC_Session *c, Group_Privacy_State privacy_state, const uint8_t
650650
*
651651
* Return group_number on success.
652652
* Return -1 if the group object fails to initialize.
653-
* Return -2 if chat_id is NULL or a group with chat_id already exists in the chats array.
653+
* Return -2 if chat_id is NULL.
654654
* Return -3 if nick is too long.
655655
* Return -4 if nick is empty or nick length is zero.
656656
* Return -5 if there is an error setting the group password.

toxcore/tox.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3698,9 +3698,7 @@ typedef enum Tox_Err_Group_Join {
36983698
TOX_ERR_GROUP_JOIN_INIT,
36993699

37003700
/**
3701-
* The chat_id pointer is set to NULL or a group with chat_id already
3702-
* exists. This usually happens if the client attempts to create multiple
3703-
* sessions for the same group.
3701+
* The chat_id pointer is set to NULL.
37043702
*/
37053703
TOX_ERR_GROUP_JOIN_BAD_CHAT_ID,
37063704

0 commit comments

Comments
 (0)