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; }