1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-22 22:23:03 +01:00

Manally merged #314 and #317

This commit is contained in:
Sean Qureshi 2013-08-04 03:52:24 -07:00
parent 337d87a3ef
commit 6f9dea8510
2 changed files with 6 additions and 2 deletions

4
chat.c
View File

@ -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;
} }

View File

@ -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];