Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt the "change occurred" API change from isotoxin-groupchat. #771

Merged
merged 1 commit into from
Feb 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions toxcore/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ static int addpeer(Group_Chats *g_c, int groupnumber, const uint8_t *real_pk, co
add_to_closest(g_c, groupnumber, real_pk, temp_pk);

if (do_gc_callback && g_c->group_namelistchange) {
g_c->group_namelistchange(g_c->m, groupnumber, g->numpeers - 1, CHAT_CHANGE_PEER_ADD, userdata);
g_c->group_namelistchange(g_c->m, groupnumber, g->numpeers - 1, CHAT_CHANGE_OCCURRED, userdata);
}

if (g->peer_on_join) {
Expand Down Expand Up @@ -543,7 +543,7 @@ static int delpeer(Group_Chats *g_c, int groupnumber, int peer_index, void *user
}

if (g_c->group_namelistchange) {
g_c->group_namelistchange(g_c->m, groupnumber, peer_index, CHAT_CHANGE_PEER_DEL, userdata);
g_c->group_namelistchange(g_c->m, groupnumber, peer_index, CHAT_CHANGE_OCCURRED, userdata);
}

if (g->peer_on_leave) {
Expand Down
3 changes: 1 addition & 2 deletions toxcore/group.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ void g_callback_group_title(Group_Chats *g_c, void (*function)(Messenger *m, uin
* Function(Group_Chats *g_c, int groupnumber, int peernumber, TOX_CHAT_CHANGE change, void *userdata)
*/
enum {
CHAT_CHANGE_PEER_ADD,
CHAT_CHANGE_PEER_DEL,
CHAT_CHANGE_OCCURRED,
CHAT_CHANGE_PEER_NAME,
};
void g_callback_group_namelistchange(Group_Chats *g_c, void (*function)(Messenger *m, int, int, uint8_t, void *));
Expand Down
9 changes: 3 additions & 6 deletions toxcore/tox.api.h
Original file line number Diff line number Diff line change
Expand Up @@ -2110,13 +2110,10 @@ namespace conference {
*/
enum class STATE_CHANGE {
/**
* A peer has joined the conference.
* Some changes to list have occurred. Rebuild of list required.
* peer_number is undefined (always 0 for api compatibility)
*/
PEER_JOIN,
/**
* A peer has exited the conference.
*/
PEER_EXIT,
LIST_CHANGED,
/**
* A peer has changed their name.
*/
Expand Down
10 changes: 3 additions & 7 deletions toxcore/tox.h
Original file line number Diff line number Diff line change
Expand Up @@ -2393,14 +2393,10 @@ void tox_callback_conference_title(Tox *tox, tox_conference_title_cb *callback);
typedef enum TOX_CONFERENCE_STATE_CHANGE {

/**
* A peer has joined the conference.
* Some changes to list have occurred. Rebuild of list required.
* peer_number is undefined (always 0 for api compatibility)
*/
TOX_CONFERENCE_STATE_CHANGE_PEER_JOIN,

/**
* A peer has exited the conference.
*/
TOX_CONFERENCE_STATE_CHANGE_PEER_EXIT,
TOX_CONFERENCE_STATE_CHANGE_LIST_CHANGED,

/**
* A peer has changed their name.
Expand Down