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

automatically update default statusmessage with version

This commit is contained in:
Jfreegman 2013-09-19 19:15:54 -04:00
parent aca6d77e8a
commit ec6b37e09e

View File

@ -307,7 +307,12 @@ void prompt_init_statusbar(ToxWindow *self, Tox *m)
snprintf(statusbar->nick, sizeof(statusbar->nick), "%s", nick);
/* temporary until statusmessage saving works */
uint8_t *statusmsg = "Toxing on Toxic v0.2.0";
uint8_t statusmsg[TOX_MAX_STATUSMESSAGE_LENGTH];
char toxic_ver[strlen(TOXICVER)+1];
strcpy(toxic_ver, TOXICVER);
char *L = strchr(toxic_ver, '_');
toxic_ver[L-toxic_ver] = '\0';
snprintf(statusmsg, sizeof(statusmsg), "Toxing on Toxic v.%s", toxic_ver);
m_set_statusmessage(m, statusmsg, strlen(statusmsg) + 1);
snprintf(statusbar->statusmsg, sizeof(statusbar->statusmsg), "%s", statusmsg);