From 44c24bdd38d1ef1b4ff8de6881d669a05faa3821 Mon Sep 17 00:00:00 2001 From: Gordon Quad Date: Mon, 5 Dec 2016 01:25:42 +0000 Subject: [PATCH] fix unwanted creation of buffers --- src/twc-message-queue.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/twc-message-queue.c b/src/twc-message-queue.c index f822d44..58bd15f 100644 --- a/src/twc-message-queue.c +++ b/src/twc-message-queue.c @@ -97,9 +97,6 @@ twc_message_queue_flush_friend(struct t_twc_profile *profile, { struct t_twc_list *message_queue = twc_message_queue_get_or_create(profile, friend_number); - struct t_twc_chat *friend_chat - = twc_chat_search_friend(profile, friend_number, true); - size_t index; struct t_twc_list_item *item; twc_list_foreach(message_queue, index, item) @@ -151,6 +148,9 @@ twc_message_queue_flush_friend(struct t_twc_profile *profile, } if (err != TOX_ERR_FRIEND_SEND_MESSAGE_OK) { + struct t_twc_chat *friend_chat + = twc_chat_search_friend(profile, friend_number, true); + weechat_printf(friend_chat->buffer, "%s%sFailed to send message: %s%s", weechat_prefix("error"),