mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-23 02:33:02 +01:00
parent
337d87a3ef
commit
6f9dea8510
4
chat.c
4
chat.c
@ -51,6 +51,7 @@ static void chat_onMessage(ToxWindow* self, int num, uint8_t* msg, uint16_t len)
|
|||||||
|
|
||||||
wattron(ctx->history, COLOR_PAIR(2));
|
wattron(ctx->history, COLOR_PAIR(2));
|
||||||
wprintw(ctx->history, "%02d:%02d:%02d ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
|
wprintw(ctx->history, "%02d:%02d:%02d ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
|
||||||
|
wattroff(ctx->history, COLOR_PAIR(2));
|
||||||
wattron(ctx->history, COLOR_PAIR(4));
|
wattron(ctx->history, COLOR_PAIR(4));
|
||||||
wprintw(ctx->history, "%s: ", nick);
|
wprintw(ctx->history, "%s: ", nick);
|
||||||
wattroff(ctx->history, COLOR_PAIR(4));
|
wattroff(ctx->history, COLOR_PAIR(4));
|
||||||
@ -116,6 +117,7 @@ static void chat_onKey(ToxWindow* self, int key) {
|
|||||||
/* make sure the string has at least non-space character */
|
/* make sure the string has at least non-space character */
|
||||||
wattron(ctx->history, COLOR_PAIR(2));
|
wattron(ctx->history, COLOR_PAIR(2));
|
||||||
wprintw(ctx->history, "%02d:%02d:%02d ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
|
wprintw(ctx->history, "%02d:%02d:%02d ", timeinfo->tm_hour, timeinfo->tm_min, timeinfo->tm_sec);
|
||||||
|
wattroff(ctx->history, COLOR_PAIR(2));
|
||||||
wattron(ctx->history, COLOR_PAIR(1));
|
wattron(ctx->history, COLOR_PAIR(1));
|
||||||
wprintw(ctx->history, "you: ", ctx->line);
|
wprintw(ctx->history, "you: ", ctx->line);
|
||||||
wattroff(ctx->history, COLOR_PAIR(1));
|
wattroff(ctx->history, COLOR_PAIR(1));
|
||||||
@ -254,6 +256,6 @@ ToxWindow new_chat(int friendnum) {
|
|||||||
x->friendnum = friendnum;
|
x->friendnum = friendnum;
|
||||||
|
|
||||||
ret.x = (void*) x;
|
ret.x = (void*) x;
|
||||||
|
free(x);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
4
prompt.c
4
prompt.c
@ -89,7 +89,9 @@ static void execute(ToxWindow* self, char* cmd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dht.ip.i = resolved_address;
|
dht.ip.i = resolved_address;
|
||||||
DHT_bootstrap(dht, hex_string_to_bin(key));
|
unsigned char *binary_string = hex_string_to_bin(key);
|
||||||
|
DHT_bootstrap(dht, binary_string);
|
||||||
|
free(binary_string);
|
||||||
}
|
}
|
||||||
else if(!strncmp(cmd, "add ", strlen("add "))) {
|
else if(!strncmp(cmd, "add ", strlen("add "))) {
|
||||||
uint8_t id_bin[32];
|
uint8_t id_bin[32];
|
||||||
|
Loading…
Reference in New Issue
Block a user