mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Syncbot fixes.
This commit is contained in:
parent
815725ab84
commit
782d68cdc3
|
@ -163,9 +163,15 @@ void send_irc_group(Tox *tox, uint8_t *msg, uint16_t len)
|
||||||
uint8_t req[len];
|
uint8_t req[len];
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
unsigned int spaces = 0;
|
||||||
|
|
||||||
for (i = 0; i < (len - 1); ++i) {
|
for (i = 0; i < (len - 1); ++i) {
|
||||||
if (msg[i + 1] == ':') {
|
if (msg[i + 1] == ' ') {
|
||||||
break;
|
++spaces;
|
||||||
|
} else {
|
||||||
|
if (spaces >= 3 && msg[i + 1] == ':') {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
req[i] = msg[i + 1];
|
req[i] = msg[i + 1];
|
||||||
|
@ -227,11 +233,6 @@ Tox *init_tox(int argc, char *argv[])
|
||||||
tox_callback_group_message(tox, ©_groupmessage, 0);
|
tox_callback_group_message(tox, ©_groupmessage, 0);
|
||||||
tox_callback_group_action(tox, ©_groupmessage, 0);
|
tox_callback_group_action(tox, ©_groupmessage, 0);
|
||||||
|
|
||||||
uint16_t port = atoi(argv[argvoffset + 2]);
|
|
||||||
unsigned char *binary_string = hex_string_to_bin(argv[argvoffset + 3]);
|
|
||||||
tox_bootstrap(tox, argv[argvoffset + 1], port, binary_string, 0);
|
|
||||||
free(binary_string);
|
|
||||||
|
|
||||||
char temp_id[128];
|
char temp_id[128];
|
||||||
printf("\nEnter the address of irc_syncbots master (38 bytes HEX format):\n");
|
printf("\nEnter the address of irc_syncbots master (38 bytes HEX format):\n");
|
||||||
|
|
||||||
|
@ -239,6 +240,11 @@ Tox *init_tox(int argc, char *argv[])
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t port = atoi(argv[argvoffset + 2]);
|
||||||
|
unsigned char *binary_string = hex_string_to_bin(argv[argvoffset + 3]);
|
||||||
|
tox_bootstrap(tox, argv[argvoffset + 1], port, binary_string, 0);
|
||||||
|
free(binary_string);
|
||||||
|
|
||||||
uint8_t *bin_id = hex_string_to_bin(temp_id);
|
uint8_t *bin_id = hex_string_to_bin(temp_id);
|
||||||
uint32_t num = tox_friend_add(tox, bin_id, (uint8_t *)"Install Gentoo", sizeof("Install Gentoo") - 1, 0);
|
uint32_t num = tox_friend_add(tox, bin_id, (uint8_t *)"Install Gentoo", sizeof("Install Gentoo") - 1, 0);
|
||||||
free(bin_id);
|
free(bin_id);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user