diff --git a/astylerc b/astylerc new file mode 100644 index 0000000..dd738b7 --- /dev/null +++ b/astylerc @@ -0,0 +1,11 @@ +--style=kr + --pad-header + --max-code-length=120 + --convert-tabs + --indent-switches + --pad-oper + --align-pointer=name + --align-reference=name + --preserve-date + --lineend=linux + --break-blocks \ No newline at end of file diff --git a/src/chat_commands.c b/src/chat_commands.c index 4c628b3..d9de05c 100644 --- a/src/chat_commands.c +++ b/src/chat_commands.c @@ -128,6 +128,7 @@ void cmd_groupinvite(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*a int groupnum = atoi(argv[1]); + if (groupnum == 0 && strcmp(argv[1], "0")) { /* atoi returns 0 value on invalid input */ line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid group number."); return; diff --git a/src/groupchat.c b/src/groupchat.c index dabeb57..0aaa969 100644 --- a/src/groupchat.c +++ b/src/groupchat.c @@ -239,6 +239,7 @@ int init_groupchat_win(Tox *m, uint32_t groupnum, const char *groupname, size_t return -1; } + groupchat_onGroupPeerJoin(&self, m, groupnum, peer_id); return 0; diff --git a/src/toxic.h b/src/toxic.h index adb2a32..4f48941 100644 --- a/src/toxic.h +++ b/src/toxic.h @@ -114,6 +114,12 @@ void on_nickchange(Tox *m, uint32_t friendnumber, const uint8_t *string, size_t void on_statuschange(Tox *m, uint32_t friendnumber, TOX_USER_STATUS status, void *userdata); void on_statusmessagechange(Tox *m, uint32_t friendnumber, const uint8_t *string, size_t length, void *userdata); void on_friendadded(Tox *m, uint32_t friendnumber, bool sort); +void on_file_chunk_request(Tox *m, uint32_t friendnumber, uint32_t filenumber, uint64_t position, size_t length, + void *userdata); +void on_groupinvite(Tox *m, int32_t friendnumber, uint8_t type, const uint8_t *group_pub_key, uint16_t length, + void *userdata); +void on_group_titlechange(Tox *m, int groupnumber, int peernumber, const uint8_t *title, uint8_t length, + void *userdata); void on_file_chunk_request(Tox *m, uint32_t friendnumber, uint32_t filenumber, uint64_t position, size_t length, void *userdata); void on_file_recv_chunk(Tox *m, uint32_t friendnumber, uint32_t filenumber, uint64_t position, const uint8_t *data,