From d71136262227d68b649ce9fd8e020597c69cce07 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Wed, 18 Mar 2015 15:32:53 -0400 Subject: Merged normal message function and send action function into one messaging function. This removes code duplication and allows us to easily add new message types to the api without having to add new functions. --- testing/tox_shell.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'testing/tox_shell.c') diff --git a/testing/tox_shell.c b/testing/tox_shell.c index 38fe6364..a7cef997 100644 --- a/testing/tox_shell.c +++ b/testing/tox_shell.c @@ -53,7 +53,8 @@ void print_online(Tox *tox, uint32_t friendnumber, TOX_CONNECTION status, void * printf("\nOther went offline.\n"); } -void print_message(Tox *tox, uint32_t friendnumber, const uint8_t *string, size_t length, void *userdata) +void print_message(Tox *tox, uint32_t friendnumber, TOX_MESSAGE_TYPE type, const uint8_t *string, size_t length, + void *userdata) { int master = *((int *)userdata); write(master, string, length); @@ -148,7 +149,7 @@ int main(int argc, char *argv[]) if (ret <= 0) break; - tox_friend_send_message(tox, num, buf, ret, 0); + tox_friend_send_message(tox, num, TOX_MESSAGE_TYPE_MESSAGE, buf, ret, 0); } tox_iterate(tox); -- cgit v1.2.3