From 50367783db4739237d36b27b149f8088a1d50f3e Mon Sep 17 00:00:00 2001 From: mjentsch Date: Mon, 14 Sep 2015 22:03:36 +0200 Subject: [PATCH] Do not display outgoing captioned images in group chats twice --- telegram-purple.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/telegram-purple.c b/telegram-purple.c index ed9e337..e7b98ee 100755 --- a/telegram-purple.c +++ b/telegram-purple.c @@ -747,8 +747,10 @@ static int tgprpl_send_chat (PurpleConnection * gc, int id, const char *message, debug ("tgprpl_send_chat()"); connection_data *conn = purple_connection_get_protocol_data (gc); int ret = tgp_msg_send (conn->TLS, message, TGL_MK_CHAT(id)); - p2tgl_got_chat_in (conn->TLS, TGL_MK_CHAT(id), TGL_MK_USER(conn->TLS->our_id), message, - PURPLE_MESSAGE_RECV, time(NULL)); + if (ret != 0) { + p2tgl_got_chat_in (conn->TLS, TGL_MK_CHAT(id), TGL_MK_USER(conn->TLS->our_id), message, + PURPLE_MESSAGE_RECV, time(NULL)); + } return ret; }