Prevented crash when typing into group chats.

This commit is contained in:
Håvard Pettersson 2014-10-05 00:06:22 +02:00
parent a30abf4ec4
commit d90e3e5b58

View File

@ -265,10 +265,12 @@ twc_chat_send_message(struct t_twc_chat *chat,
const char *message, const char *message,
enum TWC_MESSAGE_TYPE message_type) enum TWC_MESSAGE_TYPE message_type)
{ {
// TODO: fix for group messages if (chat->friend_number >= 0)
twc_message_queue_add_friend_message(chat->profile, {
chat->friend_number, twc_message_queue_add_friend_message(chat->profile,
message, message_type); chat->friend_number,
message, message_type);
}
char *name = twc_get_self_name_nt(chat->profile->tox); char *name = twc_get_self_name_nt(chat->profile->tox);
twc_chat_print_message(chat, "", name, message, message_type); twc_chat_print_message(chat, "", name, message, message_type);