mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-22 22:33:02 +01:00
Merge branch 'master' of http://github.com/irungentoo/ProjectTox-Core
Conflicts: core/Messenger.c core/Messenger.h
This commit is contained in:
commit
90acd2dfef
3
chat.c
3
chat.c
@ -57,7 +57,6 @@ static void chat_onMessage(ToxWindow *self, int num, uint8_t *msg, uint16_t len)
|
|||||||
|
|
||||||
self->blink = true;
|
self->blink = true;
|
||||||
beep();
|
beep();
|
||||||
flash();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void chat_onNickChange(ToxWindow *self, int num, uint8_t *nick, uint16_t len)
|
static void chat_onNickChange(ToxWindow *self, int num, uint8_t *nick, uint16_t len)
|
||||||
@ -121,7 +120,7 @@ static void chat_onKey(ToxWindow *self, int key)
|
|||||||
wattroff(ctx->history, COLOR_PAIR(1));
|
wattroff(ctx->history, COLOR_PAIR(1));
|
||||||
wprintw(ctx->history, "%s\n", ctx->line);
|
wprintw(ctx->history, "%s\n", ctx->line);
|
||||||
}
|
}
|
||||||
if (m_sendmessage(ctx->friendnum, (uint8_t*) ctx->line, strlen(ctx->line)+1) < 0) {
|
if (m_sendmessage(ctx->friendnum, (uint8_t*) ctx->line, strlen(ctx->line)+1) == 0) {
|
||||||
wattron(ctx->history, COLOR_PAIR(3));
|
wattron(ctx->history, COLOR_PAIR(3));
|
||||||
wprintw(ctx->history, " * Failed to send message.\n");
|
wprintw(ctx->history, " * Failed to send message.\n");
|
||||||
wattroff(ctx->history, COLOR_PAIR(3));
|
wattroff(ctx->history, COLOR_PAIR(3));
|
||||||
|
3
main.c
3
main.c
@ -22,6 +22,7 @@ extern int add_req(uint8_t *public_key); // XXX
|
|||||||
|
|
||||||
/* Holds status of chat windows */
|
/* Holds status of chat windows */
|
||||||
char WINDOW_STATUS[MAX_WINDOW_SLOTS];
|
char WINDOW_STATUS[MAX_WINDOW_SLOTS];
|
||||||
|
#define TOXICVER "0.1.0" //Will be moved to a -D flag later
|
||||||
|
|
||||||
static ToxWindow windows[MAX_WINDOW_SLOTS];
|
static ToxWindow windows[MAX_WINDOW_SLOTS];
|
||||||
static ToxWindow* prompt;
|
static ToxWindow* prompt;
|
||||||
@ -258,7 +259,7 @@ static void draw_bar()
|
|||||||
move(LINES - 1, 0);
|
move(LINES - 1, 0);
|
||||||
|
|
||||||
attron(COLOR_PAIR(4) | A_BOLD);
|
attron(COLOR_PAIR(4) | A_BOLD);
|
||||||
printw(" TOXIC 1.0 |");
|
printw(" TOXIC " TOXICVER " |");
|
||||||
attroff(COLOR_PAIR(4) | A_BOLD);
|
attroff(COLOR_PAIR(4) | A_BOLD);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
14
prompt.c
14
prompt.c
@ -62,6 +62,16 @@ static void execute(ToxWindow *self, char *u_cmd)
|
|||||||
if (!isspace(cmd[cmd_end]))
|
if (!isspace(cmd[cmd_end]))
|
||||||
break;
|
break;
|
||||||
cmd[cmd_end + 1] = '\0';
|
cmd[cmd_end + 1] = '\0';
|
||||||
|
|
||||||
|
/* What is this supposed to do?
|
||||||
|
if (cmd[0] == '/') {
|
||||||
|
wprintw(self->window,"Warning: Run your command without the /, this may not work\n");
|
||||||
|
int i;
|
||||||
|
for (i = 1; i < strlen(cmd); i++) { //This doesn't work when it doesn't end with a space and another word
|
||||||
|
cmd[i - 1] = cmd[i]; //Still working on why
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
if (!strcmp(cmd, "quit") || !strcmp(cmd, "exit") || !strcmp(cmd, "q")) {
|
if (!strcmp(cmd, "quit") || !strcmp(cmd, "exit") || !strcmp(cmd, "q")) {
|
||||||
endwin();
|
endwin();
|
||||||
@ -287,7 +297,7 @@ static void execute(ToxWindow *self, char *u_cmd)
|
|||||||
}
|
}
|
||||||
msg[0] = 0;
|
msg[0] = 0;
|
||||||
msg++;
|
msg++;
|
||||||
if (m_sendmessage(atoi(id), (uint8_t*) msg, strlen(msg)+1) < 0)
|
if (m_sendmessage(atoi(id), (uint8_t*) msg, strlen(msg)+1) == 0)
|
||||||
wprintw(self->window, "Error occurred while sending message.\n");
|
wprintw(self->window, "Error occurred while sending message.\n");
|
||||||
else
|
else
|
||||||
wprintw(self->window, "Message successfully sent.\n");
|
wprintw(self->window, "Message successfully sent.\n");
|
||||||
@ -368,7 +378,7 @@ static void print_usage(ToxWindow *self)
|
|||||||
wprintw(self->window, " myid : Print your ID\n");
|
wprintw(self->window, " myid : Print your ID\n");
|
||||||
wprintw(self->window, " quit/exit : Exit program\n");
|
wprintw(self->window, " quit/exit : Exit program\n");
|
||||||
wprintw(self->window, " help : Print this message again\n");
|
wprintw(self->window, " help : Print this message again\n");
|
||||||
wprintw(self->window, " clear : Clear this window\n");
|
wprintw(self->window, " clear : Clear this window\n");
|
||||||
|
|
||||||
wattron(self->window, A_BOLD);
|
wattron(self->window, A_BOLD);
|
||||||
wprintw(self->window, "TIP: Use the TAB key to navigate through the tabs.\n\n");
|
wprintw(self->window, "TIP: Use the TAB key to navigate through the tabs.\n\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user