From e85e9dbb999f1fccd2083224cc52eebe29915bfe Mon Sep 17 00:00:00 2001 From: "Coren[m]" Date: Sun, 24 Nov 2013 21:11:54 +0100 Subject: group_namelistchange(): for ui reasons, divulge the peernumber and the nature of the change (add, del, name change). tox.*, Messenger.*, group_chats.*: - expand interface of callback by peernumber/change groupchats.c: - call callback in addpeer/delpeer/setnick with peernumber and flag nTox.c: - print_groupchatpeers(): print as many names on a line as possible, not one peer per line - print_groupnamelistchange(): only print the change, if possible (i.e. "new peer", "peer's new name") - added command "/p" to print the list of peers --- toxcore/Messenger.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'toxcore/Messenger.c') diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index cc52c069..1a7fc230 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -785,7 +785,7 @@ void m_callback_group_message(Messenger *m, void (*function)(Messenger *m, int, * It gets called every time the name list changes(new peer/name, deleted peer) * Function(Tox *tox, int groupnumber, void *userdata) */ -void m_callback_group_namelistchange(Messenger *m, void (*function)(Messenger *m, int, void *), void *userdata) +void m_callback_group_namelistchange(Messenger *m, void (*function)(Messenger *m, int, int, uint8_t, void *), void *userdata) { m->group_namelistchange = function; m->group_namelistchange_userdata = userdata; @@ -812,7 +812,7 @@ static void group_message_function(Group_Chat *chat, int peer_number, uint8_t *m (*m->group_message)(m, i, peer_number, message, length, m->group_message_userdata); } -static void group_namelistchange_function(Group_Chat *chat, void *userdata) +static void group_namelistchange_function(Group_Chat *chat, int peer, uint8_t change, void *userdata) { Messenger *m = userdata; int i = get_chat_num(m, chat); @@ -820,7 +820,7 @@ static void group_namelistchange_function(Group_Chat *chat, void *userdata) return; if (m->group_namelistchange) - (*m->group_namelistchange)(m, i, m->group_namelistchange_userdata); + (*m->group_namelistchange)(m, i, peer, change, m->group_namelistchange_userdata); } -- cgit v1.2.3