Remove deprecated conference namelist change callback.

This commit is contained in:
iphydf 2018-02-26 21:20:16 +00:00
parent 1334d16517
commit 1282ef5741
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
6 changed files with 1 additions and 118 deletions

View File

@ -227,7 +227,7 @@ int main(int argc, char *argv[])
CHECK_SIZE(Friend_Requests, 1080); CHECK_SIZE(Friend_Requests, 1080);
// toxcore/group // toxcore/group
CHECK_SIZE(Group_c, 728); CHECK_SIZE(Group_c, 728);
CHECK_SIZE(Group_Chats, 2128); CHECK_SIZE(Group_Chats, 2120);
CHECK_SIZE(Group_Peer, 480); CHECK_SIZE(Group_Peer, 480);
// toxcore/list // toxcore/list
CHECK_SIZE(BS_LIST, 32); CHECK_SIZE(BS_LIST, 32);

View File

@ -455,10 +455,6 @@ static int addpeer(Group_Chats *g_c, uint32_t groupnumber, const uint8_t *real_p
add_to_closest(g_c, groupnumber, real_pk, temp_pk); 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);
}
if (do_gc_callback && g_c->peer_list_changed_callback) { if (do_gc_callback && g_c->peer_list_changed_callback) {
g_c->peer_list_changed_callback(g_c->m, groupnumber, userdata); g_c->peer_list_changed_callback(g_c->m, groupnumber, userdata);
} }
@ -547,10 +543,6 @@ static int delpeer(Group_Chats *g_c, uint32_t groupnumber, int peer_index, void
g->group = temp; g->group = temp;
} }
if (g_c->group_namelistchange) {
g_c->group_namelistchange(g_c->m, groupnumber, peer_index, CHAT_CHANGE_PEER_DEL, userdata);
}
if (g_c->peer_list_changed_callback) { if (g_c->peer_list_changed_callback) {
g_c->peer_list_changed_callback(g_c->m, groupnumber, userdata); g_c->peer_list_changed_callback(g_c->m, groupnumber, userdata);
} }
@ -597,10 +589,6 @@ static int setnick(Group_Chats *g_c, uint32_t groupnumber, int peer_index, const
g->group[peer_index].nick_len = nick_len; g->group[peer_index].nick_len = nick_len;
if (do_gc_callback && g_c->group_namelistchange) {
g_c->group_namelistchange(g_c->m, groupnumber, peer_index, CHAT_CHANGE_PEER_NAME, userdata);
}
if (do_gc_callback && g_c->peer_name_callback) { if (do_gc_callback && g_c->peer_name_callback) {
g_c->peer_name_callback(g_c->m, groupnumber, peer_index, nick, nick_len, userdata); g_c->peer_name_callback(g_c->m, groupnumber, peer_index, nick, nick_len, userdata);
} }
@ -1175,18 +1163,6 @@ void g_callback_peer_list_changed(Group_Chats *g_c, void (*function)(Messenger *
g_c->peer_list_changed_callback = function; g_c->peer_list_changed_callback = function;
} }
// TODO(sudden6): function signatures in comments are incorrect
/* Set callback function for peer name list changes.
*
* It gets called every time the name list changes(new peer/name, deleted peer)
* Function(Group_Chats *g_c, int groupnumber, int peernumber, TOX_CHAT_CHANGE change, void *userdata)
*/
void g_callback_group_namelistchange(Group_Chats *g_c, void (*function)(Messenger *, uint32_t, uint32_t, int,
void *))
{
g_c->group_namelistchange = function;
}
// TODO(sudden6): function signatures are incorrect // TODO(sudden6): function signatures are incorrect
/* Set callback function for title changes. /* Set callback function for title changes.
* *

View File

@ -119,7 +119,6 @@ typedef struct {
void (*message_callback)(Messenger *m, uint32_t, uint32_t, int, const uint8_t *, size_t, void *); void (*message_callback)(Messenger *m, uint32_t, uint32_t, int, const uint8_t *, size_t, void *);
void (*peer_name_callback)(Messenger *m, uint32_t, uint32_t, const uint8_t *, size_t, void *); void (*peer_name_callback)(Messenger *m, uint32_t, uint32_t, const uint8_t *, size_t, void *);
void (*peer_list_changed_callback)(Messenger *m, uint32_t, void *); void (*peer_list_changed_callback)(Messenger *m, uint32_t, void *);
void (*group_namelistchange)(Messenger *m, uint32_t, uint32_t, int, void *);
void (*title_callback)(Messenger *m, uint32_t, uint32_t, const uint8_t *, size_t, void *); void (*title_callback)(Messenger *m, uint32_t, uint32_t, const uint8_t *, size_t, void *);
struct { struct {
@ -167,18 +166,6 @@ void g_callback_peer_name(Group_Chats *g_c, void (*function)(Messenger *m, uint3
*/ */
void g_callback_peer_list_changed(Group_Chats *g_c, void (*function)(Messenger *m, uint32_t, void *)); void g_callback_peer_list_changed(Group_Chats *g_c, void (*function)(Messenger *m, uint32_t, void *));
/* Set callback function for peer name list changes.
*
* It gets called every time the name list changes(new peer/name, deleted peer)
* Function(Group_Chats *g_c, uint32_t groupnumber, uint32_t peernumber, TOX_CHAT_CHANGE change, void *userdata)
*/
enum {
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 *));
/* Creates a new groupchat and puts it in the chats array. /* Creates a new groupchat and puts it in the chats array.
* *
* type is one of GROUPCHAT_TYPE_* * type is one of GROUPCHAT_TYPE_*

View File

@ -2158,38 +2158,6 @@ namespace conference {
} }
/**
* Peer list state change types.
*/
enum class STATE_CHANGE {
/**
* A peer has joined the conference.
*/
PEER_JOIN,
/**
* A peer has exited the conference.
*/
PEER_EXIT,
/**
* A peer has changed their name.
*/
PEER_NAME_CHANGE,
}
/**
* This event is triggered when the peer list changes (name change, peer join, peer exit).
*
* @deprecated Use the `${event peer.name}` and `${event peer.list_changed}` events, instead.
*/
event namelist_change const {
/**
* @param conference_number The conference number of the conference the title change is intended for.
* @param peer_number The ID of the peer who changed the title.
* @param change The type of change (one of $STATE_CHANGE).
*/
typedef void(uint32_t conference_number, uint32_t peer_number, STATE_CHANGE change);
}
/** /**
* Creates a new conference. * Creates a new conference.

View File

@ -1116,13 +1116,6 @@ void tox_callback_conference_peer_list_changed(Tox *tox, tox_conference_peer_lis
g_callback_peer_list_changed((Group_Chats *)m->conferences_object, callback); g_callback_peer_list_changed((Group_Chats *)m->conferences_object, callback);
} }
void tox_callback_conference_namelist_change(Tox *tox, tox_conference_namelist_change_cb *callback)
{
Messenger *m = tox;
g_callback_group_namelistchange((Group_Chats *)m->conferences_object,
(void (*)(struct Messenger *, uint32_t, uint32_t, int, void *))callback);
}
uint32_t tox_conference_new(Tox *tox, TOX_ERR_CONFERENCE_NEW *error) uint32_t tox_conference_new(Tox *tox, TOX_ERR_CONFERENCE_NEW *error)
{ {
Messenger *m = tox; Messenger *m = tox;

View File

@ -2443,47 +2443,6 @@ typedef void tox_conference_peer_list_changed_cb(Tox *tox, uint32_t conference_n
*/ */
void tox_callback_conference_peer_list_changed(Tox *tox, tox_conference_peer_list_changed_cb *callback); void tox_callback_conference_peer_list_changed(Tox *tox, tox_conference_peer_list_changed_cb *callback);
/**
* Peer list state change types.
*/
typedef enum TOX_CONFERENCE_STATE_CHANGE {
/**
* A peer has joined the conference.
*/
TOX_CONFERENCE_STATE_CHANGE_PEER_JOIN,
/**
* A peer has exited the conference.
*/
TOX_CONFERENCE_STATE_CHANGE_PEER_EXIT,
/**
* A peer has changed their name.
*/
TOX_CONFERENCE_STATE_CHANGE_PEER_NAME_CHANGE,
} TOX_CONFERENCE_STATE_CHANGE;
/**
* @param conference_number The conference number of the conference the title change is intended for.
* @param peer_number The ID of the peer who changed the title.
* @param change The type of change (one of TOX_CONFERENCE_STATE_CHANGE).
*/
typedef void tox_conference_namelist_change_cb(Tox *tox, uint32_t conference_number, uint32_t peer_number,
TOX_CONFERENCE_STATE_CHANGE change, void *user_data);
/**
* Set the callback for the `conference_namelist_change` event. Pass NULL to unset.
*
* This event is triggered when the peer list changes (name change, peer join, peer exit).
*
* @deprecated Use the `conference_peer_name` and `conference_peer_list_changed` events, instead.
*/
void tox_callback_conference_namelist_change(Tox *tox, tox_conference_namelist_change_cb *callback);
typedef enum TOX_ERR_CONFERENCE_NEW { typedef enum TOX_ERR_CONFERENCE_NEW {
/** /**