Added profile to buffer names to avoid conflicts.

This commit is contained in:
Håvard Pettersson 2014-10-05 01:46:59 +02:00
parent 11609f6bb4
commit 4d852487b2

View File

@ -57,10 +57,13 @@ twc_chat_create(struct t_twc_profile *profile,
chat->profile = profile;
chat->friend_number = chat->group_number = -1;
// TODO: prepend profile name
chat->buffer = weechat_buffer_new(name,
size_t full_name_size = strlen(profile->name) + 1 + strlen(name) + 1;
char *full_name = malloc(full_name_size);
snprintf(full_name, full_name_size, "%s/%s", profile->name, name);
chat->buffer = weechat_buffer_new(full_name,
twc_chat_buffer_input_callback, chat,
twc_chat_buffer_close_callback, chat);
free(full_name);
if (!(chat->buffer))
{