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

no longer need this

This commit is contained in:
Jfreegman 2013-10-20 01:27:45 -04:00
parent 4ad6853e2e
commit 957b335559
5 changed files with 6 additions and 9 deletions

View File

@ -386,7 +386,7 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
/* RETURN key: Execute command or print line */ /* RETURN key: Execute command or print line */
else if (key == '\n') { else if (key == '\n') {
uint8_t *line = wcs_to_char(ctx->line); uint8_t *line = wcs_to_char(ctx->line);
line[ctx->pos+1] = '\0'; line[ctx->pos+1] = L'\0';
wclear(ctx->linewin); wclear(ctx->linewin);
wmove(self->window, y2 - CURS_Y_OFFSET, 0); wmove(self->window, y2 - CURS_Y_OFFSET, 0);
wclrtobot(self->window); wclrtobot(self->window);
@ -409,7 +409,7 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
else if(!strncmp(line, "/savefile ", strlen("/savefile "))) else if(!strncmp(line, "/savefile ", strlen("/savefile ")))
chat_savefile(self, ctx, m, line + strlen("/savefile ")); chat_savefile(self, ctx, m, line + strlen("/savefile "));
else else
execute(ctx->history, self->prompt, m, line, ctx->pos); execute(ctx->history, self->prompt, m, line);
} else { } else {
/* make sure the string has at least non-space character */ /* make sure the string has at least non-space character */
if (!string_is_empty(line)) { if (!string_is_empty(line)) {

View File

@ -338,13 +338,10 @@ void cmd_status(WINDOW *window, ToxWindow *prompt, Tox *m, int argc, char (*argv
if (!strcmp(l_status, "online")) if (!strcmp(l_status, "online"))
status_kind = TOX_USERSTATUS_NONE; status_kind = TOX_USERSTATUS_NONE;
else if (!strcmp(l_status, "away")) else if (!strcmp(l_status, "away"))
status_kind = TOX_USERSTATUS_AWAY; status_kind = TOX_USERSTATUS_AWAY;
else if (!strcmp(l_status, "busy")) else if (!strcmp(l_status, "busy"))
status_kind = TOX_USERSTATUS_BUSY; status_kind = TOX_USERSTATUS_BUSY;
else { else {
wprintw(window, "Invalid status. Valid statuses are: online, busy and away.\n"); wprintw(window, "Invalid status. Valid statuses are: online, busy and away.\n");
return; return;
@ -363,7 +360,7 @@ void cmd_status(WINDOW *window, ToxWindow *prompt, Tox *m, int argc, char (*argv
#define MAX_NUM_ARGS 4 /* Includes command */ #define MAX_NUM_ARGS 4 /* Includes command */
void execute(WINDOW *window, ToxWindow *prompt, Tox *m, char *u_cmd, int buf_len) void execute(WINDOW *window, ToxWindow *prompt, Tox *m, char *u_cmd)
{ {
char args[MAX_NUM_ARGS][MAX_STR_SIZE]; char args[MAX_NUM_ARGS][MAX_STR_SIZE];
int num_args = 0; int num_args = 0;

View File

@ -15,7 +15,7 @@ void cmd_note(WINDOW *, ToxWindow *, Tox *m, int, char (*argv)[MAX_STR_SIZE]);
void cmd_quit(WINDOW *, ToxWindow *, Tox *m, int, char (*argv)[MAX_STR_SIZE]); void cmd_quit(WINDOW *, ToxWindow *, Tox *m, int, char (*argv)[MAX_STR_SIZE]);
void cmd_status(WINDOW *, ToxWindow *, Tox *m, int, char (*argv)[MAX_STR_SIZE]); void cmd_status(WINDOW *, ToxWindow *, Tox *m, int, char (*argv)[MAX_STR_SIZE]);
void execute(WINDOW *window, ToxWindow *prompt, Tox *m, char *u_cmd, int buf_len); void execute(WINDOW *window, ToxWindow *prompt, Tox *m, char *u_cmd);
#define NUM_COMMANDS 13 #define NUM_COMMANDS 13

View File

@ -170,7 +170,7 @@ static void groupchat_onKey(ToxWindow *self, Tox *m, wint_t key)
} else if (strncmp(line, "/help", strlen("/help")) == 0) } else if (strncmp(line, "/help", strlen("/help")) == 0)
print_groupchat_help(ctx); print_groupchat_help(ctx);
else else
execute(ctx->history, self->prompt, m, line, ctx->pos); execute(ctx->history, self->prompt, m, line);
} else { } else {
/* make sure the string has at least non-space character */ /* make sure the string has at least non-space character */
if (!string_is_empty(line)) { if (!string_is_empty(line)) {

View File

@ -143,7 +143,7 @@ static void prompt_onKey(ToxWindow *self, Tox *m, wint_t key)
if (!strncmp(prompt_buf, "/help", strlen("/help"))) if (!strncmp(prompt_buf, "/help", strlen("/help")))
print_prompt_help(self); print_prompt_help(self);
else else
execute(self->window, self, m, prompt_buf, prompt_buf_pos); execute(self->window, self, m, prompt_buf);
prompt_buf_pos = 0; prompt_buf_pos = 0;
prompt_buf[0] = 0; prompt_buf[0] = 0;