mirror of
https://github.com/Tha14/toxic.git
synced 2026-01-24 23:43:15 +01:00
code cleanup, improve welcome message
This commit is contained in:
@@ -503,15 +503,12 @@ static void groupchat_onInit(ToxWindow *self, Tox *m)
|
||||
ctx->linewin = subwin(self->window, CHATBOX_HEIGHT, x2, y2 - CHATBOX_HEIGHT, 0);
|
||||
ctx->sidebar = subwin(self->window, y2 - CHATBOX_HEIGHT + 1, SIDEBAR_WIDTH, 0, x2 - SIDEBAR_WIDTH);
|
||||
|
||||
ctx->hst = malloc(sizeof(struct history));
|
||||
ctx->log = malloc(sizeof(struct chatlog));
|
||||
ctx->hst = calloc(1, sizeof(struct history));
|
||||
ctx->log = calloc(1, sizeof(struct chatlog));
|
||||
|
||||
if (ctx->log == NULL || ctx->hst == NULL)
|
||||
exit_toxic_err("failed in groupchat_onInit", FATALERR_MEMORY);
|
||||
|
||||
memset(ctx->hst, 0, sizeof(struct history));
|
||||
memset(ctx->log, 0, sizeof(struct chatlog));
|
||||
|
||||
line_info_init(ctx->hst);
|
||||
|
||||
if (user_settings->autolog == AUTOLOG_ON)
|
||||
@@ -538,7 +535,7 @@ ToxWindow new_group_chat(Tox *m, int groupnum)
|
||||
ret.onGroupNamelistChange = &groupchat_onGroupNamelistChange;
|
||||
ret.onGroupAction = &groupchat_onGroupAction;
|
||||
|
||||
snprintf(ret.name, sizeof(ret.name), "Room #%d", groupnum);
|
||||
snprintf(ret.name, sizeof(ret.name), "Group %d", groupnum);
|
||||
|
||||
ChatContext *chatwin = calloc(1, sizeof(ChatContext));
|
||||
Help *help = calloc(1, sizeof(Help));
|
||||
|
||||
Reference in New Issue
Block a user