mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-27 02:53:27 +01:00
fix bug in issue #104
This commit is contained in:
parent
99e36195f7
commit
3ad82cf3b1
@ -47,7 +47,7 @@ void on_request(uint8_t *public_key, uint8_t *data, uint16_t length, void *userd
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_active_windows; ++i) {
|
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||||
if (windows[i].onFriendRequest != NULL)
|
if (windows[i].onFriendRequest != NULL)
|
||||||
windows[i].onFriendRequest(&windows[i], public_key, data, length);
|
windows[i].onFriendRequest(&windows[i], public_key, data, length);
|
||||||
}
|
}
|
||||||
@ -57,7 +57,7 @@ void on_connectionchange(Tox *m, int friendnumber, uint8_t status, void *userdat
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_active_windows; ++i) {
|
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||||
if (windows[i].onConnectionChange != NULL)
|
if (windows[i].onConnectionChange != NULL)
|
||||||
windows[i].onConnectionChange(&windows[i], m, friendnumber, status);
|
windows[i].onConnectionChange(&windows[i], m, friendnumber, status);
|
||||||
}
|
}
|
||||||
@ -67,7 +67,7 @@ void on_typing_change(Tox *m, int friendnumber, int is_typing, void *userdata)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_active_windows; ++i) {
|
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||||
if (windows[i].onTypingChange != NULL)
|
if (windows[i].onTypingChange != NULL)
|
||||||
windows[i].onTypingChange(&windows[i], m, friendnumber, is_typing);
|
windows[i].onTypingChange(&windows[i], m, friendnumber, is_typing);
|
||||||
}
|
}
|
||||||
@ -77,7 +77,7 @@ void on_message(Tox *m, int friendnumber, uint8_t *string, uint16_t length, void
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_active_windows; ++i) {
|
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||||
if (windows[i].onMessage != NULL)
|
if (windows[i].onMessage != NULL)
|
||||||
windows[i].onMessage(&windows[i], m, friendnumber, string, length);
|
windows[i].onMessage(&windows[i], m, friendnumber, string, length);
|
||||||
}
|
}
|
||||||
@ -87,7 +87,7 @@ void on_action(Tox *m, int friendnumber, uint8_t *string, uint16_t length, void
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_active_windows; ++i) {
|
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||||
if (windows[i].onAction != NULL)
|
if (windows[i].onAction != NULL)
|
||||||
windows[i].onAction(&windows[i], m, friendnumber, string, length);
|
windows[i].onAction(&windows[i], m, friendnumber, string, length);
|
||||||
}
|
}
|
||||||
@ -100,7 +100,7 @@ void on_nickchange(Tox *m, int friendnumber, uint8_t *string, uint16_t length, v
|
|||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_active_windows; ++i) {
|
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||||
if (windows[i].onNickChange != NULL)
|
if (windows[i].onNickChange != NULL)
|
||||||
windows[i].onNickChange(&windows[i], m, friendnumber, string, length);
|
windows[i].onNickChange(&windows[i], m, friendnumber, string, length);
|
||||||
}
|
}
|
||||||
@ -113,7 +113,7 @@ void on_statusmessagechange(Tox *m, int friendnumber, uint8_t *string, uint16_t
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_active_windows; ++i) {
|
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||||
if (windows[i].onStatusMessageChange != NULL)
|
if (windows[i].onStatusMessageChange != NULL)
|
||||||
windows[i].onStatusMessageChange(&windows[i], friendnumber, string, length);
|
windows[i].onStatusMessageChange(&windows[i], friendnumber, string, length);
|
||||||
}
|
}
|
||||||
@ -123,7 +123,7 @@ void on_statuschange(Tox *m, int friendnumber, TOX_USERSTATUS status, void *user
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_active_windows; ++i) {
|
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||||
if (windows[i].onStatusChange != NULL)
|
if (windows[i].onStatusChange != NULL)
|
||||||
windows[i].onStatusChange(&windows[i], m, friendnumber, status);
|
windows[i].onStatusChange(&windows[i], m, friendnumber, status);
|
||||||
}
|
}
|
||||||
@ -133,7 +133,7 @@ void on_friendadded(Tox *m, int friendnumber, bool sort)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_active_windows; ++i) {
|
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||||
if (windows[i].onFriendAdded != NULL)
|
if (windows[i].onFriendAdded != NULL)
|
||||||
windows[i].onFriendAdded(&windows[i], m, friendnumber, sort);
|
windows[i].onFriendAdded(&windows[i], m, friendnumber, sort);
|
||||||
}
|
}
|
||||||
@ -147,7 +147,7 @@ void on_groupmessage(Tox *m, int groupnumber, int peernumber, uint8_t *message,
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_active_windows; ++i) {
|
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||||
if (windows[i].onGroupMessage != NULL)
|
if (windows[i].onGroupMessage != NULL)
|
||||||
windows[i].onGroupMessage(&windows[i], m, groupnumber, peernumber, message, length);
|
windows[i].onGroupMessage(&windows[i], m, groupnumber, peernumber, message, length);
|
||||||
}
|
}
|
||||||
@ -158,7 +158,7 @@ void on_groupaction(Tox *m, int groupnumber, int peernumber, uint8_t *action, ui
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_active_windows; ++i) {
|
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||||
if (windows[i].onGroupAction != NULL)
|
if (windows[i].onGroupAction != NULL)
|
||||||
windows[i].onGroupAction(&windows[i], m, groupnumber, peernumber, action, length);
|
windows[i].onGroupAction(&windows[i], m, groupnumber, peernumber, action, length);
|
||||||
}
|
}
|
||||||
@ -168,7 +168,7 @@ void on_groupinvite(Tox *m, int friendnumber, uint8_t *group_pub_key, void *user
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_active_windows; ++i) {
|
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||||
if (windows[i].onGroupInvite != NULL)
|
if (windows[i].onGroupInvite != NULL)
|
||||||
windows[i].onGroupInvite(&windows[i], m, friendnumber, group_pub_key);
|
windows[i].onGroupInvite(&windows[i], m, friendnumber, group_pub_key);
|
||||||
}
|
}
|
||||||
@ -178,7 +178,7 @@ void on_group_namelistchange(Tox *m, int groupnumber, int peernumber, uint8_t ch
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_active_windows; ++i) {
|
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||||
if (windows[i].onGroupNamelistChange != NULL)
|
if (windows[i].onGroupNamelistChange != NULL)
|
||||||
windows[i].onGroupNamelistChange(&windows[i], m, groupnumber, peernumber, change);
|
windows[i].onGroupNamelistChange(&windows[i], m, groupnumber, peernumber, change);
|
||||||
}
|
}
|
||||||
@ -189,7 +189,7 @@ void on_file_sendrequest(Tox *m, int friendnumber, uint8_t filenumber, uint64_t
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_active_windows; ++i) {
|
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||||
if (windows[i].onFileSendRequest != NULL)
|
if (windows[i].onFileSendRequest != NULL)
|
||||||
windows[i].onFileSendRequest(&windows[i], m, friendnumber, filenumber, filesize,
|
windows[i].onFileSendRequest(&windows[i], m, friendnumber, filenumber, filesize,
|
||||||
filename, filename_length);
|
filename, filename_length);
|
||||||
@ -201,7 +201,7 @@ void on_file_control (Tox *m, int friendnumber, uint8_t receive_send, uint8_t fi
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_active_windows; ++i) {
|
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||||
if (windows[i].onFileControl != NULL)
|
if (windows[i].onFileControl != NULL)
|
||||||
windows[i].onFileControl(&windows[i], m, friendnumber, receive_send, filenumber,
|
windows[i].onFileControl(&windows[i], m, friendnumber, receive_send, filenumber,
|
||||||
control_type, data, length);
|
control_type, data, length);
|
||||||
@ -213,7 +213,7 @@ void on_file_data(Tox *m, int friendnumber, uint8_t filenumber, uint8_t *data, u
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < num_active_windows; ++i) {
|
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||||
if (windows[i].onFileData != NULL)
|
if (windows[i].onFileData != NULL)
|
||||||
windows[i].onFileData(&windows[i], m, friendnumber, filenumber, data, length);
|
windows[i].onFileData(&windows[i], m, friendnumber, filenumber, data, length);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user