1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-06-26 20:47:45 +02:00

a couple formatting fixes

This commit is contained in:
Jfreegman 2014-11-14 22:35:23 -05:00
parent 76c21c8b34
commit 1bd880708b
No known key found for this signature in database
GPG Key ID: 3627F3144076AE63
2 changed files with 4 additions and 6 deletions

View File

@ -33,7 +33,7 @@ void cmd_set_title(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg
char title[MAX_STR_SIZE];
if (argc < 1) {
snprintf(title, sizeof(title), "Group title: %s", self->name);
snprintf(title, sizeof(title), "Title is set to: %s", self->name);
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, MAGENTA, title);
return;
}
@ -62,7 +62,7 @@ void cmd_set_title(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*arg
uint16_t sn_len = tox_get_self_name(m, (uint8_t *) selfnick);
selfnick[sn_len] = '\0';
line_info_add(self, timefrmt, selfnick, title, NAME_CHANGE, 0, 0, " changed the group title to ");
line_info_add(self, timefrmt, selfnick, NULL, NAME_CHANGE, 0, 0, " set the group title to: %s", title);
char tmp_event[MAX_STR_SIZE];
snprintf(tmp_event, sizeof(tmp_event), "set title to %s", title);

View File

@ -285,20 +285,18 @@ static void groupchat_onGroupTitleChange(ToxWindow *self, Tox *m, int groupnum,
set_window_title(self, title, length);
char event[MAX_STR_SIZE];
char timefrmt[TIME_STR_SIZE];
get_time_str(timefrmt, sizeof(timefrmt));
/* announce title when we join the room */
if (!timed_out(groupchats[self->num].start_time, get_unix_time(), GROUP_EVENT_WAIT)) {
snprintf(event, sizeof(event), "Title set to: %s", title);
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, MAGENTA, event);
line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, MAGENTA, "Title is set to: %s", title);
return;
}
char nick[TOX_MAX_NAME_LENGTH];
get_group_nick_truncate(m, nick, peernum, groupnum);
line_info_add(self, timefrmt, nick, title, NAME_CHANGE, 0, 0, (char *) "changed the group title to");
line_info_add(self, timefrmt, nick, NULL, NAME_CHANGE, 0, 0, " set the group title to: %s", title);
char tmp_event[MAX_STR_SIZE];
snprintf(tmp_event, sizeof(tmp_event), "set title to %s", title);