mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-13 01:03:03 +01:00
no longer need this
This commit is contained in:
parent
4ad6853e2e
commit
957b335559
@ -386,7 +386,7 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
|
||||
/* RETURN key: Execute command or print line */
|
||||
else if (key == '\n') {
|
||||
uint8_t *line = wcs_to_char(ctx->line);
|
||||
line[ctx->pos+1] = '\0';
|
||||
line[ctx->pos+1] = L'\0';
|
||||
wclear(ctx->linewin);
|
||||
wmove(self->window, y2 - CURS_Y_OFFSET, 0);
|
||||
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 ")))
|
||||
chat_savefile(self, ctx, m, line + strlen("/savefile "));
|
||||
else
|
||||
execute(ctx->history, self->prompt, m, line, ctx->pos);
|
||||
execute(ctx->history, self->prompt, m, line);
|
||||
} else {
|
||||
/* make sure the string has at least non-space character */
|
||||
if (!string_is_empty(line)) {
|
||||
|
@ -338,13 +338,10 @@ void cmd_status(WINDOW *window, ToxWindow *prompt, Tox *m, int argc, char (*argv
|
||||
|
||||
if (!strcmp(l_status, "online"))
|
||||
status_kind = TOX_USERSTATUS_NONE;
|
||||
|
||||
else if (!strcmp(l_status, "away"))
|
||||
status_kind = TOX_USERSTATUS_AWAY;
|
||||
|
||||
else if (!strcmp(l_status, "busy"))
|
||||
status_kind = TOX_USERSTATUS_BUSY;
|
||||
|
||||
else {
|
||||
wprintw(window, "Invalid status. Valid statuses are: online, busy and away.\n");
|
||||
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 */
|
||||
|
||||
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];
|
||||
int num_args = 0;
|
||||
|
@ -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_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
|
||||
|
||||
|
@ -170,7 +170,7 @@ static void groupchat_onKey(ToxWindow *self, Tox *m, wint_t key)
|
||||
} else if (strncmp(line, "/help", strlen("/help")) == 0)
|
||||
print_groupchat_help(ctx);
|
||||
else
|
||||
execute(ctx->history, self->prompt, m, line, ctx->pos);
|
||||
execute(ctx->history, self->prompt, m, line);
|
||||
} else {
|
||||
/* make sure the string has at least non-space character */
|
||||
if (!string_is_empty(line)) {
|
||||
|
@ -143,7 +143,7 @@ static void prompt_onKey(ToxWindow *self, Tox *m, wint_t key)
|
||||
if (!strncmp(prompt_buf, "/help", strlen("/help")))
|
||||
print_prompt_help(self);
|
||||
else
|
||||
execute(self->window, self, m, prompt_buf, prompt_buf_pos);
|
||||
execute(self->window, self, m, prompt_buf);
|
||||
|
||||
prompt_buf_pos = 0;
|
||||
prompt_buf[0] = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user