From 1bd880708bdb0700742d01a9816a1a64162c4422 Mon Sep 17 00:00:00 2001 From: Jfreegman Date: Fri, 14 Nov 2014 22:35:23 -0500 Subject: [PATCH] a couple formatting fixes --- src/group_commands.c | 4 ++-- src/groupchat.c | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/group_commands.c b/src/group_commands.c index d0aad45..12d341e 100644 --- a/src/group_commands.c +++ b/src/group_commands.c @@ -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); diff --git a/src/groupchat.c b/src/groupchat.c index bc8695f..d2cfc52 100644 --- a/src/groupchat.c +++ b/src/groupchat.c @@ -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);