mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-26 21:43:26 +01:00
save nicks and exit tox properly
This commit is contained in:
parent
0be84ecbb3
commit
20d1ad9842
@ -270,6 +270,7 @@ void execute(ToxWindow *self, ChatContext *ctx, Tox *m, char *cmd)
|
|||||||
|
|
||||||
else if (!strcmp(cmd, "/quit") || !strcmp(cmd, "/exit") || !strcmp(cmd, "/q")) {
|
else if (!strcmp(cmd, "/quit") || !strcmp(cmd, "/exit") || !strcmp(cmd, "/q")) {
|
||||||
endwin();
|
endwin();
|
||||||
|
tox_kill(m);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,6 +235,7 @@ void cmd_connect(ToxWindow *self, Tox *m, int argc, char **argv)
|
|||||||
void cmd_quit(ToxWindow *self, Tox *m, int argc, char **argv)
|
void cmd_quit(ToxWindow *self, Tox *m, int argc, char **argv)
|
||||||
{
|
{
|
||||||
endwin();
|
endwin();
|
||||||
|
tox_kill(m);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,8 +64,11 @@ void on_nickchange(Tox *m, int friendnumber, uint8_t *string, uint16_t length, v
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
|
||||||
if (windows[i].onNickChange != NULL)
|
if (windows[i].onNickChange != NULL) {
|
||||||
windows[i].onNickChange(&windows[i], friendnumber, string, length);
|
windows[i].onNickChange(&windows[i], friendnumber, string, length);
|
||||||
|
if (store_data(m, DATA_FILE))
|
||||||
|
wprintw(prompt->window, "\nCould not store Tox data\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user