diff options
author | Coren[m] <Break@Ocean> | 2013-11-24 21:11:54 +0100 |
---|---|---|
committer | Coren[m] <Break@Ocean> | 2013-11-24 21:12:26 +0100 |
commit | e85e9dbb999f1fccd2083224cc52eebe29915bfe (patch) | |
tree | f70324093fbb926aa9523d97d5287729d9f183e7 /toxcore/Messenger.c | |
parent | 2b94408adc5e8ebdd7115b32c3ad3318a36f294b (diff) |
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
Diffstat (limited to 'toxcore/Messenger.c')
-rw-r--r-- | toxcore/Messenger.c | 6 |
1 files changed, 3 insertions, 3 deletions
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, | |||
785 | * It gets called every time the name list changes(new peer/name, deleted peer) | 785 | * It gets called every time the name list changes(new peer/name, deleted peer) |
786 | * Function(Tox *tox, int groupnumber, void *userdata) | 786 | * Function(Tox *tox, int groupnumber, void *userdata) |
787 | */ | 787 | */ |
788 | void m_callback_group_namelistchange(Messenger *m, void (*function)(Messenger *m, int, void *), void *userdata) | 788 | void m_callback_group_namelistchange(Messenger *m, void (*function)(Messenger *m, int, int, uint8_t, void *), void *userdata) |
789 | { | 789 | { |
790 | m->group_namelistchange = function; | 790 | m->group_namelistchange = function; |
791 | m->group_namelistchange_userdata = userdata; | 791 | m->group_namelistchange_userdata = userdata; |
@@ -812,7 +812,7 @@ static void group_message_function(Group_Chat *chat, int peer_number, uint8_t *m | |||
812 | (*m->group_message)(m, i, peer_number, message, length, m->group_message_userdata); | 812 | (*m->group_message)(m, i, peer_number, message, length, m->group_message_userdata); |
813 | } | 813 | } |
814 | 814 | ||
815 | static void group_namelistchange_function(Group_Chat *chat, void *userdata) | 815 | static void group_namelistchange_function(Group_Chat *chat, int peer, uint8_t change, void *userdata) |
816 | { | 816 | { |
817 | Messenger *m = userdata; | 817 | Messenger *m = userdata; |
818 | int i = get_chat_num(m, chat); | 818 | int i = get_chat_num(m, chat); |
@@ -820,7 +820,7 @@ static void group_namelistchange_function(Group_Chat *chat, void *userdata) | |||
820 | return; | 820 | return; |
821 | 821 | ||
822 | if (m->group_namelistchange) | 822 | if (m->group_namelistchange) |
823 | (*m->group_namelistchange)(m, i, m->group_namelistchange_userdata); | 823 | (*m->group_namelistchange)(m, i, peer, change, m->group_namelistchange_userdata); |
824 | } | 824 | } |
825 | 825 | ||
826 | 826 | ||