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

Allow empty status messages

This commit is contained in:
jfreegman 2018-10-04 12:43:43 -04:00
parent 63cc23401a
commit 94d22a8853
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63
3 changed files with 4 additions and 4 deletions

View File

@ -494,7 +494,7 @@ static void prompt_onFriendRequest(ToxWindow *self, Tox *m, const char *key, con
sound_notify(self, generic_message, NT_WNDALERT_1 | NT_NOTIFWND, NULL);
}
void prompt_init_statusbar(ToxWindow *self, Tox *m)
void prompt_init_statusbar(ToxWindow *self, Tox *m, bool first_time_run)
{
int x2, y2;
getmaxyx(self->window, y2, x2);
@ -524,7 +524,7 @@ void prompt_init_statusbar(ToxWindow *self, Tox *m)
nick[n_len] = '\0';
statusmsg[s_len] = '\0';
if (s_len == 0 || !strncmp(statusmsg, "Toxing on Toxic", strlen("Toxing on Toxic"))) {
if (first_time_run) {
snprintf(statusmsg, sizeof(statusmsg), "Toxing on Toxic");
s_len = strlen(statusmsg);
statusmsg[s_len] = '\0';

View File

@ -45,7 +45,7 @@ extern FriendRequests FrndRequests;
ToxWindow new_prompt(void);
void prep_prompt_win(void);
void prompt_init_statusbar(ToxWindow *self, Tox *m);
void prompt_init_statusbar(ToxWindow *self, Tox *m, bool first_time_run);
void prompt_update_nick(ToxWindow *prompt, const char *nick);
void prompt_update_statusmessage(ToxWindow *prompt, Tox *m, const char *statusmsg);
void prompt_update_status(ToxWindow *prompt, TOX_USER_STATUS status);

View File

@ -1285,7 +1285,7 @@ int main(int argc, char **argv)
init_term();
prompt = init_windows(m);
prompt_init_statusbar(prompt, m);
prompt_init_statusbar(prompt, m, !datafile_exists);
load_groups(prompt, m);
/* thread for ncurses stuff */