Skip to content

Commit

Permalink
Revert "Adopt the "change occurred" API change from isotoxin-groupchat."
Browse files Browse the repository at this point in the history
This reverts commit a940f26.
  • Loading branch information
iphydf committed Feb 19, 2018
1 parent dca8c71 commit 62ea20b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
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_OCCURRED, userdata);
g_c->group_namelistchange(g_c->m, groupnumber, g->numpeers - 1, CHAT_CHANGE_PEER_ADD, userdata);
}

if (do_gc_callback && g_c->peer_list_changed_callback) {
Expand Down Expand Up @@ -547,7 +547,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_OCCURRED, userdata);
g_c->group_namelistchange(g_c->m, groupnumber, peer_index, CHAT_CHANGE_PEER_DEL, userdata);
}

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

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

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

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

0 comments on commit 62ea20b

Please sign in to comment.